Bug 1280600: Cleanup Android linker flags and libraries, r=glandium draft
authorThomas Zimmermann <tdz@users.sourceforge.net>
Mon, 11 Jul 2016 14:57:06 +0200
changeset 386251 55e0de6f8395edea08794cd5f12d465af981b2e0
parent 386250 2eee66918f9a51f00a09b59bc12013c876abda88
child 386252 4d1c563576e8a47b63be3a0e5f186a3065324b24
push id22651
push usertdz@users.sourceforge.net
push dateMon, 11 Jul 2016 13:01:55 +0000
reviewersglandium
bugs1280600
milestone50.0a1
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
build/autoconf/android.m4
old-configure.in
--- 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