Bug 1260996 - Don't set HOST_{C,CXX,LD}FLAGS from {C,CXX,LD}FLAGS on cross compiles. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 31 Mar 2016 18:11:19 +0900
changeset 346203 3c2ef6cb7c1f083de8dd21d01853cd7421814e7d
parent 345774 a21a7ef3d8834e3ba1d87c03ca3ec2ea4920100e
child 517361 91a69c8438482c0fea18544e4c70302544a829c9
push id14282
push userbmo:mh+mozilla@glandium.org
push dateThu, 31 Mar 2016 09:13:20 +0000
reviewersgps
bugs1260996
milestone48.0a1
Bug 1260996 - Don't set HOST_{C,CXX,LD}FLAGS from {C,CXX,LD}FLAGS on cross compiles. r?gps The only cross compiles we actively support were resetting pre-setting those values to avoid it anyways, so it wasn't doing anything useful.
build/autoconf/toolchain.m4
js/src/old-configure.in
old-configure.in
--- a/build/autoconf/toolchain.m4
+++ b/build/autoconf/toolchain.m4
@@ -130,25 +130,16 @@ fi
 AC_MSG_RESULT([$HOST_CC])
 AC_MSG_CHECKING([for host c++ compiler])
 AC_CHECK_PROGS(HOST_CXX, c++ g++ clang++ cl, "")
 if test -z "$HOST_CXX"; then
     AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
 fi
 AC_MSG_RESULT([$HOST_CXX])
 
-if test -z "$HOST_CFLAGS"; then
-    HOST_CFLAGS="$CFLAGS"
-fi
-if test -z "$HOST_CXXFLAGS"; then
-    HOST_CXXFLAGS="$CXXFLAGS"
-fi
-if test -z "$HOST_LDFLAGS"; then
-    HOST_LDFLAGS="$LDFLAGS"
-fi
 if test -z "$HOST_AR_FLAGS"; then
     HOST_AR_FLAGS="$AR_FLAGS"
 fi
 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
 CC="$HOST_CC"
 CFLAGS="$HOST_CFLAGS"
 LDFLAGS="$HOST_LDFLAGS"
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -98,30 +98,16 @@ if test -n "$gonkdir" ; then
     CPPFLAGS="-DANDROID $TARGET_C_INCLUDES -I$gonkdir/frameworks/base/native/include -I$gonkdir/system/core/include -isystem $gonkdir/bionic $CPPFLAGS -I$gonkdir/external/valgrind/fxos-include"
     CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS $STLPORT_CPPFLAGS"
     LIBS="$LIBS $STLPORT_LIBS"
 
     dnl Add -llog by default, since we use it all over the place.
     LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
 
-    dnl prevent cross compile section from using these flags as host flags
-    if test -z "$HOST_CPPFLAGS" ; then
-        HOST_CPPFLAGS=" "
-    fi
-    if test -z "$HOST_CFLAGS" ; then
-        HOST_CFLAGS=" "
-    fi
-    if test -z "$HOST_CXXFLAGS" ; then
-        HOST_CXXFLAGS=" "
-    fi
-    if test -z "$HOST_LDFLAGS" ; then
-        HOST_LDFLAGS=" "
-    fi
-
     AC_DEFINE(ANDROID)
     AC_DEFINE(GONK)
 else
     MOZ_ANDROID_NDK
 fi
 
 case "$target" in
 *-apple-darwin*)
--- a/old-configure.in
+++ b/old-configure.in
@@ -189,30 +189,16 @@ if test -n "$gonkdir" ; then
     CPPFLAGS="-DANDROID $TARGET_C_INCLUDES -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/hardware/libhardware/include -I$gonkdir/external/valgrind/fxos-include $GONK_INCLUDES $CPPFLAGS"
     CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS $STLPORT_CPPFLAGS"
     dnl Add -llog by default, since we use it all over the place.
     LIBS="$LIBS -llog"
 
     LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ $LDFLAGS"
 
-    dnl prevent cross compile section from using these flags as host flags
-    if test -z "$HOST_CPPFLAGS" ; then
-        HOST_CPPFLAGS=" "
-    fi
-    if test -z "$HOST_CFLAGS" ; then
-        HOST_CFLAGS=" "
-    fi
-    if test -z "$HOST_CXXFLAGS" ; then
-        HOST_CXXFLAGS=" "
-    fi
-    if test -z "$HOST_LDFLAGS" ; then
-        HOST_LDFLAGS=" "
-    fi
-
     AC_DEFINE(ANDROID)
     AC_DEFINE_UNQUOTED(ANDROID_VERSION, $ANDROID_VERSION)
     AC_SUBST(ANDROID_VERSION)
     AC_DEFINE(HAVE_SYS_UIO_H)
     AC_DEFINE(HAVE_PTHREADS)
     MOZ_CHROME_FILE_FORMAT=omni
     direct_nspr_config=1
     android_cxx_stl=mozstlport