aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2013-01-17 22:11:28 -0800
committerAndrew Hsieh <andrewhsieh@google.com>2013-01-17 22:11:28 -0800
commit9e9a074a457f0db61a0f7977bbf5e3c4afebe2e0 (patch)
treeeca7a2cfd8098c0f8f3ce9f5346315b7976bef73
parent3f77a3681c1fa11021577869d272be9c4d72e7fc (diff)
downloadllvm-9e9a074a457f0db61a0f7977bbf5e3c4afebe2e0.tar.gz
Fix canadian build
1. Add new flags CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD and use it for $BUILD_CC Similiar to https://android-review.googlesource.com/#/c/50032 2. unset LDFLAGS for cross-compile-build-tools 3. ARCH can be set by env. var. Change-Id: I061aee782384ea14166043308490f31e48c6dd54
-rw-r--r--Makefile1
-rwxr-xr-xconfigure6
-rwxr-xr-xprojects/sample/configure4
3 files changed, 8 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ec24862ad6f..7d680e4bf8f 100644
--- a/Makefile
+++ b/Makefile
@@ -111,6 +111,7 @@ cross-compile-build-tools:
cd BuildTools ; \
unset CFLAGS ; \
unset CXXFLAGS ; \
+ unset LDFLAGS ; \
$(PROJ_SRC_DIR)/configure --build=$(BUILD_TRIPLE) \
--host=$(BUILD_TRIPLE) --target=$(BUILD_TRIPLE) \
--disable-polly ; \
diff --git a/configure b/configure
index a4c1592c8a3..7b8326d3479 100755
--- a/configure
+++ b/configure
@@ -3920,7 +3920,7 @@ case "$llvm_cv_target_arch" in
*) LLVM_NATIVE_ARCH="$llvm_cv_target_arch" ;;
esac
-ARCH=$llvm_cv_target_arch
+test -z "$ARCH" && ARCH=$llvm_cv_target_arch
@@ -4784,6 +4784,8 @@ fi
fi
fi
BUILD_CC=$ac_cv_prog_BUILD_CC
+test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="$CFLAGS $CPPFLAGS"
+test -z "$LDFLAGS_FOR_BUILD" && LDFLAGS_FOR_BUILD="$LDFLAGS"
if test -n "$BUILD_CC"; then
{ echo "$as_me:$LINENO: result: $BUILD_CC" >&5
echo "${ECHO_T}$BUILD_CC" >&6; }
@@ -4798,7 +4800,7 @@ 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'
+ 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=
diff --git a/projects/sample/configure b/projects/sample/configure
index 7c5e2ee37db..dd05ad737ef 100755
--- a/projects/sample/configure
+++ b/projects/sample/configure
@@ -4728,6 +4728,8 @@ fi
fi
fi
BUILD_CC=$ac_cv_prog_BUILD_CC
+test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="$CFLAGS $CPPFLAGS"
+test -z "$LDFLAGS_FOR_BUILD" && LDFLAGS_FOR_BUILD="$LDFLAGS"
if test -n "$BUILD_CC"; then
{ echo "$as_me:$LINENO: result: $BUILD_CC" >&5
echo "${ECHO_T}$BUILD_CC" >&6; }
@@ -4742,7 +4744,7 @@ 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'
+ 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=