Bug 856404 - Don't default HOST_* variables to target ones when
authorJacek Caban <jacek@codeweavers.com>
Mon, 18 May 2015 18:27:04 -0700
changeset 4635 337fef1625311f904397ecbc6880d3d24555e3ee
parent 4634 cfda142e3c2b51075ec74464816f96028bfd1d44
child 4636 8a0c03ebc2d9d803602caf0dcbd2edede84dfd75
push id172
push userwtc@google.com
push dateTue, 19 May 2015 01:27:27 +0000
bugs856404
Bug 856404 - Don't default HOST_* variables to target ones when cross compiling. r=ted
configure
configure.in
--- a/configure
+++ b/configure
@@ -2661,29 +2661,16 @@ esac
 # Check whether --with-gonk was given.
 if test "${with_gonk+set}" = set; then :
   withval=$with_gonk; gonkdir=$withval
 fi
 
 
 if test -n "$gonkdir" ; then
 
-        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
-
     $as_echo "#define ANDROID 1" >>confdefs.h
 
 else
 case "$target" in
 *-android*|*-linuxandroid*)
     if test -z "$android_ndk" ; then
        as_fn_error $? "You must specify --with-android-ndk=/path/to/ndk when targeting Android." "$LINENO" 5
     fi
@@ -2758,29 +2745,16 @@ case "$target" in
     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
     STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
 
     CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
     CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
     LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
 
-        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
-
     $as_echo "#define ANDROID 1" >>confdefs.h
 
     ;;
 esac
 fi
 
 dist_prefix='${MOD_DEPTH}/dist'
 dist_bindir='${dist_prefix}/bin'
@@ -4616,22 +4590,16 @@ fi
 done
 test -n "$HOST_CC" || HOST_CC=""""
 
     if test -z "$HOST_CC"; then
         as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOST_CC" >&5
 $as_echo "$HOST_CC" >&6; }
-    if test -z "$HOST_CFLAGS"; then
-        HOST_CFLAGS="$CFLAGS"
-    fi
-    if test -z "$HOST_LDFLAGS"; then
-        HOST_LDFLAGS="$LDFLAGS"
-    fi
 
     CC="$HOST_CC"
     CFLAGS="$HOST_CFLAGS"
     LDFLAGS="$HOST_LDFLAGS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
 $as_echo_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works... " >&6; }
 
--- a/configure.in
+++ b/configure.in
@@ -155,30 +155,16 @@ dnl ====================================
 
 AC_ARG_WITH(gonk,
 [  --with-gonk=DIR         location of gonk dir],
     gonkdir=$withval)
 
 if test -n "$gonkdir" ; then
     dnl Most things are directly configured by env vars when building for gonk
 
-    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)
 else
 case "$target" in
 *-android*|*-linuxandroid*)
     if test -z "$android_ndk" ; then
        AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
     fi
 
@@ -252,30 +238,16 @@ case "$target" in
     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
     STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
 
     CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
     CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
     LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $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)
     ;;
 esac
 fi
 
 dnl ========================================================
 dnl =
 dnl = Check options that may affect the compiler
@@ -648,22 +620,16 @@ if test "$target" != "$host"; then
     _SAVE_LDFLAGS="$LDFLAGS"
 
     AC_MSG_CHECKING([for $host compiler])
     AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
     if test -z "$HOST_CC"; then
         AC_MSG_ERROR([no acceptable cc found in \$PATH])
     fi
     AC_MSG_RESULT([$HOST_CC])
-    if test -z "$HOST_CFLAGS"; then
-        HOST_CFLAGS="$CFLAGS"
-    fi
-    if test -z "$HOST_LDFLAGS"; then
-        HOST_LDFLAGS="$LDFLAGS"
-    fi
 
     CC="$HOST_CC"
     CFLAGS="$HOST_CFLAGS"
     LDFLAGS="$HOST_LDFLAGS"
 
     AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
     AC_TRY_COMPILE([], [return 0;],
         [AC_MSG_RESULT([yes])],