diff options
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | distrib/configure.ac.in | 3 | ||||
-rw-r--r-- | m4/fp_cc_supports_target.m4 | 19 |
3 files changed, 16 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac index 9f673ba2d8..9bcfae04c6 100644 --- a/configure.ac +++ b/configure.ac @@ -667,8 +667,10 @@ LLVMTarget_CPP=` echo "$LlvmTarget"` AC_SUBST(LLVMTarget_CPP) dnl ** See whether cc supports --target=<triple> and set -dnl CONF_CC_OPTS_STAGE[12] accordingly. -FP_CC_SUPPORTS_TARGET +dnl CONF_CC_OPTS_STAGE[012] accordingly. +FP_CC_SUPPORTS_TARGET([$CC_STAGE0], [CONF_CC_OPTS_STAGE0], [CONF_CXX_OPTS_STAGE0], [CONF_GCC_LINKER_OPTS_STAGE0]) +FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_CXX_OPTS_STAGE1], [CONF_GCC_LINKER_OPTS_STAGE1]) +FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_CXX_OPTS_STAGE2], [CONF_GCC_LINKER_OPTS_STAGE2]) # See rules/distdir-way-opts.mk for details. # Flags passed to the C compiler diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in index 9b7abd5867..a1fbf79a14 100644 --- a/distrib/configure.ac.in +++ b/distrib/configure.ac.in @@ -201,7 +201,8 @@ AC_SUBST(TargetHasGnuNonexecStack) dnl ** See whether cc supports --target=<triple> and set dnl CONF_CC_OPTS_STAGE[12] accordingly. -FP_CC_SUPPORTS_TARGET +FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE1], [CONF_CXX_OPTS_STAGE1], [CONF_GCC_LINK_OPTS_STAGE1]) +FP_CC_SUPPORTS_TARGET([$CC], [CONF_CC_OPTS_STAGE2], [CONF_CXX_OPTS_STAGE2], [CONF_GCC_LINK_OPTS_STAGE2]) dnl TargetWordSize for settings file AC_CHECK_SIZEOF(void *, 4) diff --git a/m4/fp_cc_supports_target.m4 b/m4/fp_cc_supports_target.m4 index e8710b8ffc..6021361256 100644 --- a/m4/fp_cc_supports_target.m4 +++ b/m4/fp_cc_supports_target.m4 @@ -6,13 +6,17 @@ # # The primary effect of this is updating CONF_CC_OPTS_STAGE[12] to # explicitly ask the compiler to generate code for the $TargetPlatform. +# +# $1 = CC +# $2 = CC_OPTS variable +# $3 = CXX_OPTS variable +# $4 = GCC_LINK_OPTS variable AC_DEFUN([FP_CC_SUPPORTS_TARGET], [ - AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([GHC_LLVM_TARGET_SET_VAR]) - AC_MSG_CHECKING([whether $1 CC supports --target]) + AC_MSG_CHECKING([whether $1 supports --target]) echo 'int main() { return 0; }' > conftest.c - if $CC --target=$LlvmTarget -Werror conftest.c > /dev/null 2>&1 ; then + if $1 --target=$LlvmTarget -Werror conftest.c > /dev/null 2>&1 ; then CONF_CC_SUPPORTS_TARGET=YES AC_MSG_RESULT([yes]) else @@ -22,12 +26,9 @@ AC_DEFUN([FP_CC_SUPPORTS_TARGET], rm -f conftest.c conftest if test $CONF_CC_SUPPORTS_TARGET = YES ; then - CONF_CC_OPTS_STAGE1="--target=$LlvmTarget $CONF_CC_OPTS_STAGE1" - CONF_CC_OPTS_STAGE2="--target=$LlvmTarget $CONF_CC_OPTS_STAGE2" - CONF_CXX_OPTS_STAGE1="--target=$LlvmTarget $CONF_CXX_OPTS_STAGE1" - CONF_CXX_OPTS_STAGE2="--target=$LlvmTarget $CONF_CXX_OPTS_STAGE2" - CONF_GCC_LINKER_OPTS_STAGE1="--target=$LlvmTarget $CONF_GCC_LINKER_OPTS_STAGE1" - CONF_GCC_LINKER_OPTS_STAGE2="--target=$LlvmTarget $CONF_GCC_LINKER_OPTS_STAGE2" + $2="--target=$LlvmTarget $$2" + $3="--target=$LlvmTarget $$3" + $4="--target=$LlvmTarget $$4" fi ]) |