From 8c3dd809a066dc9d34ff15ab55b0a8181112959a Mon Sep 17 00:00:00 2001 From: Nathan Lanza Date: Tue, 27 Mar 2018 23:38:51 +0000 Subject: [PATCH] add option to build shared icu libraries instead of static --- build.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 6f062e2..b467076 100755 --- a/build.sh +++ b/build.sh @@ -172,7 +172,7 @@ cd $BUILDDIR/$ARCH cd $BUILDDIR/$ARCH -[ -e libicuuc.a ] || { +[ -e libicuuc.a ] || [ -e libicuuc.so ] { rm -rf icu @@ -194,6 +194,12 @@ cd $BUILDDIR/$ARCH sed -i,tmp "s@LD_SONAME *=.*@LD_SONAME =@g" config/mh-linux sed -i,tmp "s%ln -s *%cp -f \$(dir \$@)/%g" config/mh-linux + if [ $SHARED_ICU ]; then + libtype='--enable-shared --disable-static' + else + libtype='--enable-static --disable-shared' + fi + env CFLAGS="-I$NDK/sources/android/support/include -frtti -fexceptions" \ LDFLAGS="-frtti -fexceptions -L$BUILDDIR/$ARCH/lib" \ LIBS="-L$BUILDDIR/$ARCH -landroid_support `$BUILDDIR/setCrossEnvironment-$ARCH.sh sh -c 'echo $LDFLAGS'`" \ @@ -203,7 +209,7 @@ cd $BUILDDIR/$ARCH --host=$GCCPREFIX \ --prefix=`pwd`/../../ \ --with-cross-build=`pwd`/cross \ - --enable-static --disable-shared \ + $libtype \ --with-data-packaging=archive \ || exit 1 @@ -224,8 +230,11 @@ cd $BUILDDIR/$ARCH make V=1 install || exit 1 for f in libicudata libicutest libicui18n libicuio libicutu libicuuc; do - #cp -f -H ../../lib/$f.so ../../ - cp -f ../../lib/$f.a ../../ + if [ $SHARED_ICU ]; then + cp -f -H ../../lib/$f.so ../../ + else + cp -f ../../lib/$f.a ../../ + fi #$BUILDDIR/setCrossEnvironment-$ARCH.sh \ # sh -c '$STRIP'" ../../$f.so" done