Skip to content

Commit 4bc78f4

Browse files
author
Gonzalo Larralde
authored
Merge pull request #7 from gonzalolarralde/libsuffix
Add an ENVVAR to append a suffix to the lib names.
2 parents 877921d + f843f77 commit 4bc78f4

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

build.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,18 @@ cd $BUILDDIR/$ARCH
7777

7878
# =========== libicuXX.so ===========
7979

80-
[ -e libicuuc.so ] || {
80+
[ -e libicuuc$LIBSUFFIX.so ] || {
8181

8282
[ -e ../icu4c-55_1-src.tgz ] || exit 1
8383

8484
tar xvf ../icu4c-55_1-src.tgz
8585

86+
# The ENVVAR LIBSUFFIX should add the suffix only to the libname and not to the symbols.
87+
# ToDo: Find the right way in Swift to refer to an alternative library with symbol prefixing or any other method to remove this.
88+
if $[ -n "$LIBSUFFIX" ]; then
89+
patch -p0 < ../patches/icu_suffix_only_on_libname.patch
90+
fi
91+
8692
cd icu/source
8793

8894
#cp -f $BUILDDIR/config.sub .
@@ -104,6 +110,7 @@ cd $BUILDDIR/$ARCH
104110
./configure \
105111
--host=arm-linux-androideabi \
106112
--prefix=`pwd`/../../ \
113+
--with-library-suffix=$LIBSUFFIX \
107114
--with-cross-build=`pwd`/cross \
108115
--enable-static --enable-shared \
109116
|| exit 1
@@ -119,7 +126,7 @@ cd $BUILDDIR/$ARCH
119126
$BUILDDIR/setCrossEnvironment-$ARCH.sh \
120127
make V=1 install || exit 1
121128

122-
for f in libicudata libicutest libicui18n libicuio libicule libiculx libicutu libicuuc; do
129+
for f in libicudata$LIBSUFFIX libicutest$LIBSUFFIX libicui18n$LIBSUFFIX libicuio$LIBSUFFIX libicule$LIBSUFFIX libiculx$LIBSUFFIX libicutu$LIBSUFFIX libicuuc$LIBSUFFIX; do
123130
cp -f -H ../../lib/$f.so ../../
124131
cp -f ../../lib/$f.a ../../
125132
$BUILDDIR/setCrossEnvironment-$ARCH.sh \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- icu/source/configure 2013-05-23 20:06:32.000000000 +0000
2+
+++ icu/source/configure.patched 2018-02-21 23:35:25.934967613 +0000
3+
@@ -7217,14 +7217,7 @@
4+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $msg" >&5
5+
$as_echo "$msg" >&6; }
6+
7+
-if test "$ICULIBSUFFIX" != ""
8+
-then
9+
- U_HAVE_LIB_SUFFIX=1
10+
- ICULIBSUFFIXCNAME=`echo _$ICULIBSUFFIX | sed 's/^A-Za-z0-9_/_/g'`
11+
- UCONFIG_CPPFLAGS="${UCONFIG_CPPFLAGS} -DU_HAVE_LIB_SUFFIX=1 -DU_LIB_SUFFIX_C_NAME=${ICULIBSUFFIXCNAME} "
12+
-else
13+
- U_HAVE_LIB_SUFFIX=0
14+
-fi
15+
+U_HAVE_LIB_SUFFIX=0
16+
17+
18+

0 commit comments

Comments
 (0)