Bug 1280600: Cleanup Android linker flags and libraries, r=glandium
Android and b2g have duplicated linker flags and libraries. This patch
removes the duplicates from b2g scripts. The library 'log' is now listed
in the correct variable 'LIBS'.
MozReview-Commit-ID: EtVzZpoXkdK
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -64,21 +64,22 @@ case "$target" in
AC_MSG_ERROR([not found. Please check your NDK. With the current configuration, it should be in $android_platform])
fi
CPPFLAGS="-idirafter $android_platform/usr/include $CPPFLAGS"
CFLAGS="-fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-fno-short-enums -fno-exceptions $CXXFLAGS"
ASFLAGS="-idirafter $android_platform/usr/include -DANDROID $ASFLAGS"
- dnl Add -llog by default, since we use it all over the place.
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
dnl undefined symbol (present on the hardware, just not in the
dnl NDK.)
- LDFLAGS="-L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
+ LDFLAGS="-L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -Wl,--allow-shlib-undefined $LDFLAGS"
+ dnl Add -llog by default, since we use it all over the place.
+ LIBS="-llog $LIBS"
ANDROID_PLATFORM="${android_platform}"
AC_DEFINE(ANDROID)
AC_SUBST(ANDROID_PLATFORM)
;;
esac
--- a/old-configure.in
+++ b/old-configure.in
@@ -166,18 +166,16 @@ if test -n "$gonkdir"; then
fi
if test -d "$gonkdir/external/bluetooth/bluez"; then
MOZ_B2G_BT=1
MOZ_B2G_BT_BLUEZ=1
fi
CPPFLAGS="-I$gonkdir/system -I$gonkdir/system/core/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/external/valgrind/fxos-include $CPPFLAGS"
LDFLAGS="-L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib $LDFLAGS"
- dnl Add -llog by default, since we use it all over the place.
- LIBS="$LIBS -llog"
AC_DEFINE(ANDROID)
AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
AC_DEFINE(HAVE_SYS_UIO_H)
AC_DEFINE(HAVE_PTHREADS)
dnl ANDROID_VERSION is only required for the AC_SUBST below
ANDROID_VERSION=$android_version