Skip to content

Commit

Permalink
Merge pull request #8 from lanza/sharing-is-caring
Browse files Browse the repository at this point in the history
add option to build shared icu libraries instead of static
  • Loading branch information
pelya authored Apr 6, 2018
2 parents db4f112 + 8c3dd80 commit a0436ea
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ cd $BUILDDIR/$ARCH

cd $BUILDDIR/$ARCH

[ -e libicuuc.a ] || {
[ -e libicuuc.a ] || [ -e libicuuc.so ] {

rm -rf icu

Expand All @@ -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'`" \
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit a0436ea

Please sign in to comment.