Skip to content

Commit 886a4a0

Browse files
committed
add suffix to icu libraries
1 parent 8a57f01 commit 886a4a0

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

build.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,19 @@ cd $BUILDDIR/$ARCH
172172

173173
cd $BUILDDIR/$ARCH
174174

175-
[ -e libicuuc.a ] || [ -e libicuuc.so ] || [ $SKIP_ICUUC ] {
175+
[ -e libicuuc$LIBSUFFIX.a ] || [ -e libicuuc$LIBSUFFIX.so ] || [ $SKIP_ICUUC ] || {
176176

177177
rm -rf icu
178178

179179
tar xvf ../icu4c-59_1-src.tgz
180180

181+
# The ENVVAR LIBSUFFIX should add the suffix only to the libname and not to the symbols.
182+
# ToDo: Find the right way in Swift to refer to an alternative library with symbol prefixing or any other method to
183+
# remove this.
184+
if [ $LIBSUFFIX ]; then
185+
patch -p0 < ../patches/icu_suffix_only_on_libname.patch
186+
fi
187+
181188
cd icu/source
182189

183190
cp -f $BUILDDIR/config.sub .
@@ -208,6 +215,7 @@ cd $BUILDDIR/$ARCH
208215
./configure \
209216
--host=$GCCPREFIX \
210217
--prefix=`pwd`/../../ \
218+
--with-library-suffix=$LIBSUFFIX \
211219
--with-cross-build=`pwd`/cross \
212220
$libtype \
213221
--with-data-packaging=archive \
@@ -229,7 +237,7 @@ cd $BUILDDIR/$ARCH
229237
$BUILDDIR/setCrossEnvironment-$ARCH.sh \
230238
make V=1 install || exit 1
231239

232-
for f in libicudata libicutest libicui18n libicuio libicutu libicuuc; do
240+
for f in libicudata$LIBSUFFIX libicutest$LIBSUFFIX libicui18n$LIBSUFFIX libicuio$LIBSUFFIX libicutu$LIBSUFFIX libicuuc$LIBSUFFIX; do
233241
if [ $SHARED_ICU ]; then
234242
cp -f -H ../../lib/$f.so ../../
235243
else
@@ -270,12 +278,15 @@ cd $BUILDDIR/$ARCH
270278
--enable-static --enable-shared \
271279
|| exit 1
272280

281+
cmd='$LD $CFLAGS -shared src/.libs/*.o -o src/.libs/libicu-le-hb.so.0.0.0 -L../lib -lharfbuzz $LDFLAGS'
282+
cmd="$cmd -licuuc$LIBSUFFIX"
283+
273284
env PATH=`pwd`:$PATH \
274285
$BUILDDIR/setCrossEnvironment-$ARCH.sh \
275286
make V=1 || \
276287
env PATH=`pwd`:$PATH \
277288
$BUILDDIR/setCrossEnvironment-$ARCH.sh \
278-
sh -c '$LD $CFLAGS -shared src/.libs/*.o -o src/.libs/libicu-le-hb.so.0.0.0 -L../lib -lharfbuzz -licuuc $LDFLAGS' || exit 1
289+
sh -c "$cmd" || exit 1
279290

280291
env PATH=`pwd`:$PATH \
281292
$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)