Skip to content

Commit e97bfc8

Browse files
Build with ICU correctly (#1228)
Patch configure.ac to use pkg-config for ICU detection Use --with-icusword in configure arguments rather than hard defining it Don't pass weird arguments to --with-icu
1 parent 85c6995 commit e97bfc8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

win32/build_sword.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tar xzf sword.tar.gz
99
cd sword-1.9.0
1010
# It confuses gcc when you have this
1111
sed -i configure.ac -e 's#-no-undefined##'
12+
sed -i configure.ac -e 's#with_icu=no#PKG_CHECK_MODULES([ICU],[icu-uc icu-io icu-i18n],false,true)\nAM_CFLAGS="$AM_CFLAGS -D_ICU_"\nAM_CXXFLAGS="$AM_CXXFLAGS -D_ICU_"\nLIBS="$LIBS $ICU_LIBS"#'
1213
# But ld NEEDS to have it for the shared library
1314
sed -i lib/Makefile.am -E -e 's#libsword_la_LDFLAGS =(.*)#libsword_la_LDFLAGS = -no-undefined \1#'
1415
autoreconf
@@ -23,7 +24,7 @@ function build_sword {
2324
export RANLIB="${arch}-w64-mingw32-ranlib"
2425
export STRIP="${arch}-w64-mingw32-strip"
2526
export LD="${arch}-w64-mingw32-ld"
26-
export CFLAGS="-I/usr/${arch}-w64-mingw32/sys-root/mingw/include -I$(pwd)/../sword-1.9.0/include -D_ICUSWORD_"
27+
export CFLAGS="-I/usr/${arch}-w64-mingw32/sys-root/mingw/include -I$(pwd)/../sword-1.9.0/include"
2728
export CXXFLAGS="${CXXFLAGS} ${CFLAGS}"
2829
export LDFLAGS="-L/usr/${arch}-w64-mingw32/sys-root/mingw/lib"
2930
export PATH="/usr/${arch}-w64-mingw32/sys-root/mingw/bin:${PATH}"
@@ -33,6 +34,7 @@ function build_sword {
3334
../sword-1.9.0/configure \
3435
--enable-shared \
3536
--disable-static \
37+
--with-icusword \
3638
--host=${arch}-w64-mingw32 \
3739
--target=${arch}-w64-mingw32 \
3840
--build=${arch}-linux-gnu \
@@ -50,9 +52,8 @@ function build_sword {
5052
--sharedstatedir=/usr/${arch}-w64-mingw32/sys-root/mingw/com \
5153
--mandir=/usr/${arch}-w64-mingw32/sys-root/mingw/share/man \
5254
--infodir=/usr/${arch}-w64-mingw32/sys-root/mingw/share/info \
53-
--with-clucene=/usr/${arch}-w64-mingw32/sys-root/mingw \
54-
--with-icu=/usr/${arch}-w64-mingw32/sys-root/mingw || cat config.log
55-
make -j10
55+
--with-clucene=/usr/${arch}-w64-mingw32/sys-root/mingw || cat config.log
56+
make -j10 || cat config.log
5657
make install
5758
mv "utilities/.libs/addld.exe" "/usr/${arch}-w64-mingw32/sys-root/mingw/bin/addld.exe"
5859
cd ..

0 commit comments

Comments
 (0)