| # Copyright 2016 The Fuchsia Authors. All rights reserved. |
| # |
| # Redistribution and use in source and binary forms, with or without |
| # modification, are permitted provided that the following conditions |
| # are met: |
| # |
| # 1. Redistributions of source code must retain the above copyright |
| # notice, this list of conditions and the following disclaimer. |
| # 2. Redistributions in binary form must reproduce the above copyright |
| # notice, this list of conditions and the following disclaimer in the |
| # documentation and/or other materials provided with the distribution. |
| # |
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY |
| # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
| set -e |
| |
| ignore_stamp=false |
| |
| while getopts ":s" arg; do |
| case $arg in |
| s) # Do a clean build |
| ignore_stamp=true |
| ;; |
| h | *) # Display help. |
| usage |
| exit 0 |
| ;; |
| esac |
| done |
| |
| source $(dirname $BASH_SOURCE)/common.sh |
| source $(dirname $BASH_SOURCE)/deps.sh |
| |
| component_name=$(basename $BASH_SOURCE .sh) |
| |
| if [ $ignore_stamp = "true" ]; then |
| __has_stamp="false" |
| else |
| has_stamp $component_name |
| fi |
| |
| if [ $__has_stamp = "false" ]; then |
| |
| out_dir=$FUCHSIA_ROOT/out/debug-x86-64 |
| |
| $FUCHSIA_ROOT/build/gn/gen.py -m boringssl |
| $FUCHSIA_ROOT/buildtools/ninja -C $out_dir |
| |
| cp $FUCHSIA_OUT_DIR/debug-x86-64/libcrypto.so $FUCHSIA_CROSS_ROOT/lib |
| cp $FUCHSIA_OUT_DIR/debug-x86-64/libssl.so $FUCHSIA_CROSS_ROOT/lib |
| cp -r $FUCHSIA_ROOT/third_party/boringssl/include/openssl $FUCHSIA_CROSS_ROOT/include |
| |
| make_stamp $component_name |
| fi |