@@ -172,7 +172,7 @@ cd $BUILDDIR/$ARCH
172172
173173cd $BUILDDIR /$ARCH
174174
175- [ -e libicuuc.a ] || {
175+ [ -e libicuuc.a ] || [ -e libicuuc.so ] {
176176
177177 rm -rf icu
178178
@@ -194,6 +194,12 @@ cd $BUILDDIR/$ARCH
194194 sed -i,tmp " s@LD_SONAME *=.*@LD_SONAME =@g" config/mh-linux
195195 sed -i,tmp " s%ln -s *%cp -f \$ (dir \$ @)/%g" config/mh-linux
196196
197+ if [ $SHARED_ICU ]; then
198+ libtype=' --enable-shared --disable-static'
199+ else
200+ libtype=' --enable-static --disable-shared'
201+ fi
202+
197203 env CFLAGS=" -I$NDK /sources/android/support/include -frtti -fexceptions" \
198204 LDFLAGS=" -frtti -fexceptions -L$BUILDDIR /$ARCH /lib" \
199205 LIBS=" -L$BUILDDIR /$ARCH -landroid_support ` $BUILDDIR /setCrossEnvironment-$ARCH .sh sh -c ' echo $LDFLAGS' ` " \
@@ -203,7 +209,7 @@ cd $BUILDDIR/$ARCH
203209 --host=$GCCPREFIX \
204210 --prefix=` pwd` /../../ \
205211 --with-cross-build=` pwd` /cross \
206- --enable-static --disable-shared \
212+ $libtype \
207213 --with-data-packaging=archive \
208214 || exit 1
209215
@@ -224,8 +230,11 @@ cd $BUILDDIR/$ARCH
224230 make V=1 install || exit 1
225231
226232 for f in libicudata libicutest libicui18n libicuio libicutu libicuuc; do
227- # cp -f -H ../../lib/$f.so ../../
228- cp -f ../../lib/$f .a ../../
233+ if [ $SHARED_ICU ]; then
234+ cp -f -H ../../lib/$f .so ../../
235+ else
236+ cp -f ../../lib/$f .a ../../
237+ fi
229238 # $BUILDDIR/setCrossEnvironment-$ARCH.sh \
230239 # sh -c '$STRIP'" ../../$f.so"
231240 done
0 commit comments