| # 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 |
| |
| source $(dirname $BASH_SOURCE)/common.sh |
| source $(dirname $BASH_SOURCE)/deps.sh |
| |
| has_stamp icu |
| |
| if [ $__has_stamp = "false" ]; then |
| |
| require_deps zlib |
| |
| ICU_ROOT=$WM_DEPS_SOURCE_DIR/icu |
| ICU_SRC=$ICU_ROOT/source |
| |
| if [ ! -d "$ICU_ROOT" ]; then |
| cd $WM_DEPS_SOURCE_DIR |
| if [ ! -f icu4c-57_1-src.tgz ]; then |
| wget http://download.icu-project.org/files/icu4c/57.1/icu4c-57_1-src.tgz |
| fi |
| |
| tar xvfz icu4c-57_1-src.tgz |
| cp $ICU_ROOT/source/config/mh-linux $ICU_ROOT/source/config/mh-unknown |
| fi |
| |
| HOST_BUILD=$FUCHSIA_OUT_DIR/icu_host_build |
| |
| if [ x$1 == xclean ] ; then |
| rm -rf $HOST_BUILD |
| fi |
| |
| if [ ! -f $HOST_BUILD/config/icucross.mk ]; then |
| mkdir -p $HOST_BUILD |
| cd $HOST_BUILD |
| $ICU_SRC/configure --prefix=$HOME/local --with-data-packaging=static --enable-static --disable-shared |
| make $PARALLEL |
| fi |
| |
| FUCHSIA_BUILD=$FUCHSIA_CROSS_ROOT/icu_fuchsia_build |
| if [ x$1 == xclean ] ; then |
| rm -rf $FUCHSIA_BUILD |
| fi |
| mkdir -p $FUCHSIA_BUILD |
| cd $FUCHSIA_BUILD |
| |
| source $script_dir/fuchsia_toolchain.sh |
| |
| $ICU_SRC/configure --prefix=$FUCHSIA_CROSS_ROOT --with-data-packaging=static --enable-static --disable-shared --disable-tools --disable-tests --host=x86_64-fuchsia-elf -with-cross-build=$HOST_BUILD |
| make $PARALLEL |
| make install |
| |
| make_stamp icu |
| fi |