aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2013-05-22 17:11:20 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2015-03-24 11:54:44 -0700
commit1699c89ab85349e65053dc5dfc6cf4209b0d8fba (patch)
tree8f8d09a349dba0ab674ab22edbd04b03ca5064b1
parente5218b7d1f3ebee9b7f3957400f2767fd291fae0 (diff)
downloadllvm-1699c89ab85349e65053dc5dfc6cf4209b0d8fba.tar.gz
[ndk][conf] Fix Canadian build.
1. Add new two new flags: CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD and use them in $BUILD_CC test. 2. Unset $LDFLAGS in cross-compile-build-tools. 3. $ARCH can be overrided by environment variable. Cherry-picked from release_34 branch. Regenerated with ./autoconf/AutoRegen.sh.
-rw-r--r--Makefile1
-rw-r--r--autoconf/configure.ac4
-rw-r--r--autoconf/m4/build_exeext.m45
-rwxr-xr-xconfigure9
4 files changed, 15 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 2b9468af205..69532da2347 100644
--- a/Makefile
+++ b/Makefile
@@ -112,6 +112,7 @@ cross-compile-build-tools:
cd BuildTools ; \
unset CFLAGS ; \
unset CXXFLAGS ; \
+ unset LDFLAGS ; \
AR=$(BUILD_AR) ; \
AS=$(BUILD_AS) ; \
LD=$(BUILD_LD) ; \
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 59b54a33329..dfcb9f787bb 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -438,7 +438,9 @@ case "$llvm_cv_target_arch" in
esac
dnl Define a substitution, ARCH, for the target architecture
-AC_SUBST(ARCH,$llvm_cv_target_arch)
+if test -z "$ARCH" ; then
+ AC_SUBST(ARCH,$llvm_cv_target_arch)
+fi
AC_SUBST(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCH)
dnl Determine what our host architecture.
diff --git a/autoconf/m4/build_exeext.m4 b/autoconf/m4/build_exeext.m4
index 1bdecc1ba57..410d815a6db 100644
--- a/autoconf/m4/build_exeext.m4
+++ b/autoconf/m4/build_exeext.m4
@@ -18,7 +18,10 @@ else
fi
fi
test -z "$BUILD_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
- ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
+ test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="$CFLAGS $CPPFLAGS"
+ test -z "$LDFLAGS_FOR_BUILD" && LDFLAGS_FOR_BUILD="$LDFLAGS"
+ ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
+
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_build_exeext=
diff --git a/configure b/configure
index 005b56736d9..c1bcda1c961 100755
--- a/configure
+++ b/configure
@@ -4161,8 +4161,10 @@ case "$llvm_cv_target_arch" in
*) LLVM_NATIVE_ARCH="$llvm_cv_target_arch" ;;
esac
-ARCH=$llvm_cv_target_arch
+if test -z "$ARCH" ; then
+ ARCH=$llvm_cv_target_arch
+fi
LLVM_NATIVE_ARCH=$LLVM_NATIVE_ARCH
@@ -4340,7 +4342,10 @@ fi
test -z "$BUILD_CC" && { { echo "$as_me:$LINENO: error: no acceptable cc found in \$PATH" >&5
echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
{ (exit 1); exit 1; }; }
- ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+ test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="$CFLAGS $CPPFLAGS"
+ test -z "$LDFLAGS_FOR_BUILD" && LDFLAGS_FOR_BUILD="$LDFLAGS"
+ ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS_FOR_BUILD $LDFLAGS_FOR_BUILD conftest.$ac_ext $LIBS 1>&5'
+
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_build_exeext=