Skip to content

Commit

Permalink
[test-android] really fix build scripts.
Browse files Browse the repository at this point in the history
Changes are from FluidSynth#897 (comment)
  • Loading branch information
atsushieno committed Jun 6, 2021
1 parent 14c7c53 commit 008d765
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
10 changes: 5 additions & 5 deletions test-android/build-scripts/build-call-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ source ./build-env.sh
-DANDROID_ABI=$ANDROID_ABI_CMAKE \
-DANDROID_TOOLCHAIN=$CC \
-DANDROID_NDK=$NDK \
-DANDROID_COMPILER_FLAGS="${CFLAGS}" \
-DANDROID_LINKER_FLAGS="${LDFLAGS}" \
-DANDROID_COMPILER_FLAGS="${CFLAGS// /;}" \
-DANDROID_LINKER_FLAGS="${LDFLAGS// /;}" \
-DANDROID_STL="c++_shared" \
-DCMAKE_REQUIRED_FLAGS="${CFLAGS}" \
-DCMAKE_REQUIRED_LINK_OPTIONS="${LDFLAGS}" \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_STAGING_PREFIX=$PREFIX \
-DCMAKE_REQUIRED_LINK_OPTIONS="${LDFLAGS// /;}" \
-DCMAKE_INSTALL_PREFIX=${PREFIX} \
-DCMAKE_STAGING_PREFIX=${PREFIX} \
-DBUILD_SHARED_LIBS=1 \
-DLIB_SUFFIX="" \
$parameters_cmakeArgs ..
Expand Down
2 changes: 1 addition & 1 deletion test-android/build-scripts/build-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export ANDROID_API=24
# Tell configure what flags Android requires.
# Turn Wimplicit-function-declaration into errors. Else autotools will be fooled when checking for available functions (that in fact are NOT available) and compilation will fail later on.
# Also disable clangs integrated assembler, as the hand written assembly of libffi is not recognized by it, cf. https://crbug.com/801303
export CFLAGS="-fPIE -fPIC -I$PREFIX/include --sysroot=$NDK_TOOLCHAIN/sysroot -I$NDK_TOOLCHAIN/sysroot/usr/include -Werror=implicit-function-declaration -fno-integrated-as"
export CFLAGS="-fPIE -fPIC -I$PREFIX/include --sysroot=$NDK_TOOLCHAIN/sysroot -I$NDK_TOOLCHAIN/sysroot/usr/include -Werror=implicit-function-declaration"
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS

Expand Down
17 changes: 10 additions & 7 deletions test-android/build-scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@
./configure \
--host=$AUTOTOOLS_TARGET \
--prefix=$PREFIX \
--libdir=$LIBPATH0 \
--disable-rpath \
--disable-static \
--enable-shared \
--enable-static \
--disable-shared \
--with-pic \
--disable-maintainer-mode \
--disable-silent-rules \
Expand All @@ -69,7 +70,7 @@
# install headers into the conventional ${PREFIX}/include rather than ${PREFIX}/lib/libffi-3.2.1/include.
#sed -e '/^includesdir/ s/$(libdir).*$/$(includedir)/' -i include/Makefile.in
#sed -e '/^includedir/ s/=.*$/=@includedir@/' -e 's/^Cflags: -I${includedir}/Cflags:/' -i libffi.pc.in
LDFLAGS="$LDFLAGS -Wl,-soname,libffi.so" ./configure --host=$AUTOTOOLS_TARGET --prefix=$PREFIX --enable-shared --disable-static
LDFLAGS="$LDFLAGS -Wl,-soname,libffi.so" ./configure --host=$AUTOTOOLS_TARGET --prefix=$PREFIX --enable-static --disable-shared --libdir=$LIBPATH0
make -j$((`nproc`+1)) || exit 1
make install || exit 1
popd
Expand All @@ -83,21 +84,22 @@
./configure \
--host=$AUTOTOOLS_TARGET \
--prefix=$PREFIX \
--libdir=$LIBPATH0 \
--disable-rpath \
--disable-libasprintf \
--disable-java \
--disable-native-java \
--disable-openmp \
--disable-curses \
--disable-static \
--enable-shared \
--enable-static \
--disable-shared \
--with-pic \
--disable-maintainer-mode \
--disable-silent-rules \
--disable-gtk-doc \
--disable-introspection
make -j$((`nproc`+1)) || echo "Failed to build gettext(-tools), but it is expected. We continue build..."
make install || echo "Failed to build gettext(-tools), but it is expected. We continue build..."
make -j$((`nproc`+1))
make install
popd

# glib
Expand Down Expand Up @@ -146,6 +148,7 @@ EOF
./configure \
--host=$ANDROID_TARGET \
--prefix=$PREFIX \
--libdir=$LIBPATH0 \
--disable-dependency-tracking \
--cache-file=android.cache \
--enable-included-printf \
Expand Down

0 comments on commit 008d765

Please sign in to comment.