summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-10-27 03:01:37 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-02 01:37:08 -0400
commit37a37139160f628a0ce3b27d8269fcf86d226f71 (patch)
tree1a82616b41c105cb8dfe4ece11f8fb9caf0b77d3
parentf1a782dd29480c4570465ea0aa06008bbf444e13 (diff)
downloadhaskell-37a37139160f628a0ce3b27d8269fcf86d226f71.tar.gz
Separate some AC_SUBST / AC_DEFINE
Eventually, the RTS configure alone will need the vast majority of AC_DEFINE, and the top-level configure will need the most AC_SUBST. By removing the "side effects" of the macros like this we make them more reusable so they can be shared between the two configures without doing too much.
-rw-r--r--configure.ac10
-rw-r--r--m4/fp_cc_llvm_backend.m42
-rw-r--r--m4/fp_leading_underscore.m47
3 files changed, 10 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 7c0f80cf68..634210b151 100644
--- a/configure.ac
+++ b/configure.ac
@@ -799,6 +799,9 @@ FP_GCC_EXTRA_FLAGS
dnl ** look to see if we have a C compiler using an llvm back end.
dnl
FP_CC_LLVM_BACKEND
+AS_IF([test x"$CcLlvmBackend" = x"YES"],
+ [AC_DEFINE([CC_LLVM_BACKEND], [1], [Define (to 1) if C compiler has an LLVM back end])])
+AC_SUBST(CcLlvmBackend)
FPTOOLS_SET_C_LD_FLAGS([target],[CFLAGS],[LDFLAGS],[IGNORE_LINKER_LD_FLAGS],[CPPFLAGS])
FPTOOLS_SET_C_LD_FLAGS([build],[CONF_CC_OPTS_STAGE0],[CONF_GCC_LINKER_OPTS_STAGE0],[CONF_LD_LINKER_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
@@ -1183,6 +1186,13 @@ FPTOOLS_FLOAT_WORD_ORDER_BIGENDIAN
dnl ** check for leading underscores in symbol names
FP_LEADING_UNDERSCORE
+AC_SUBST([LeadingUnderscore], [`echo $fptools_cv_leading_underscore | sed 'y/yesno/YESNO/'`])
+if test x"$fptools_cv_leading_underscore" = xyes; then
+ AC_SUBST([CabalLeadingUnderscore],[True])
+ AC_DEFINE([LEADING_UNDERSCORE], [1], [Define to 1 if C symbols have a leading underscore added by the compiler.])
+else
+ AC_SUBST([CabalLeadingUnderscore],[False])
+fi
FP_VISIBILITY_HIDDEN
diff --git a/m4/fp_cc_llvm_backend.m4 b/m4/fp_cc_llvm_backend.m4
index 75cdf759bf..521c5b8cba 100644
--- a/m4/fp_cc_llvm_backend.m4
+++ b/m4/fp_cc_llvm_backend.m4
@@ -5,14 +5,12 @@ AC_DEFUN([FP_CC_LLVM_BACKEND],
AC_MSG_CHECKING([whether C compiler has an LLVM back end])
$CC -x c /dev/null -dM -E > conftest.txt 2>&1
if grep "__llvm__" conftest.txt >/dev/null 2>&1; then
- AC_DEFINE([CC_LLVM_BACKEND], [1], [Define (to 1) if C compiler has an LLVM back end])
CcLlvmBackend=YES
AC_MSG_RESULT([yes])
else
CcLlvmBackend=NO
AC_MSG_RESULT([no])
fi
- AC_SUBST(CcLlvmBackend)
rm -f conftest.txt
])
diff --git a/m4/fp_leading_underscore.m4 b/m4/fp_leading_underscore.m4
index 5fac9f9624..fde57c7625 100644
--- a/m4/fp_leading_underscore.m4
+++ b/m4/fp_leading_underscore.m4
@@ -46,11 +46,4 @@ char **argv;
}]])],[fptools_cv_leading_underscore=yes],[fptools_cv_leading_underscore=no],[fptools_cv_leading_underscore=no])
;;
esac]);
-AC_SUBST([LeadingUnderscore], [`echo $fptools_cv_leading_underscore | sed 'y/yesno/YESNO/'`])
-if test x"$fptools_cv_leading_underscore" = xyes; then
- AC_SUBST([CabalLeadingUnderscore],[True])
- AC_DEFINE([LEADING_UNDERSCORE], [1], [Define to 1 if C symbols have a leading underscore added by the compiler.])
-else
- AC_SUBST([CabalLeadingUnderscore],[False])
-fi
])# FP_LEADING_UNDERSCORE