diff options
author | Logan Chien <loganchien@google.com> | 2013-05-22 17:11:20 +0800 |
---|---|---|
committer | Logan Chien <tzuhsiang.chien@gmail.com> | 2014-09-16 00:03:43 +0800 |
commit | 7501825dfb080c895267f2cbac2771bb56e91fad (patch) | |
tree | 10a39d86e59f1f768080df5172bac1d0230eec6e | |
parent | a8d4d135b714ee06f4034e45c050732eea7481ac (diff) | |
download | llvm-7501825dfb080c895267f2cbac2771bb56e91fad.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-- | Makefile | 1 | ||||
-rw-r--r-- | autoconf/configure.ac | 4 | ||||
-rw-r--r-- | autoconf/m4/build_exeext.m4 | 5 | ||||
-rwxr-xr-x | configure | 9 |
4 files changed, 15 insertions, 4 deletions
@@ -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 34fadbe6fe3..c5dd9b62741 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -444,7 +444,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 c11c3958fa7..5df71db8a7d 100755 --- a/configure +++ b/configure @@ -4166,8 +4166,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 @@ -4345,7 +4347,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= |