[Git][ghc/ghc][master] Revert "configure: Drop uses of AC_PROG_CC_C99"
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Fri Jan 6 04:02:56 UTC 2023
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
b2a2db04 by Matthew Pickering at 2023-01-05T23:02:30-05:00
Revert "configure: Drop uses of AC_PROG_CC_C99"
This reverts commit 7c6de18dd3151ead954c210336728e8686c91de6.
Centos7 using a very old version of the toolchain (autotools-2.69) where
the behaviour of these macros has not yet changed. I am reverting this
without haste as it is blocking the 9.6 branch.
Fixes #22704
- - - - -
3 changed files:
- configure.ac
- distrib/configure.ac.in
- + m4/fp_set_cflags_c99.m4
Changes:
=====================================
configure.ac
=====================================
@@ -485,6 +485,11 @@ FP_CPP_CMD_WITH_ARGS(HaskellCPPCmd, HaskellCPPArgs)
AC_SUBST([HaskellCPPCmd])
AC_SUBST([HaskellCPPArgs])
+FP_SET_CFLAGS_C99([CC],[CFLAGS],[CPPFLAGS])
+FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
+FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
+FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
+
dnl ** Which ld to use
dnl --------------------------------------------------------------
AC_ARG_VAR(LD,[Use as the path to ld. See also --disable-ld-override.])
=====================================
distrib/configure.ac.in
=====================================
@@ -111,6 +111,11 @@ FP_CPP_CMD_WITH_ARGS(HaskellCPPCmd, HaskellCPPArgs)
AC_SUBST([HaskellCPPCmd])
AC_SUBST([HaskellCPPArgs])
+FP_SET_CFLAGS_C99([CC],[CFLAGS],[CPPFLAGS])
+dnl FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
+FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
+FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
+
dnl ** Which ld to use?
dnl --------------------------------------------------------------
FIND_LD([$target],[GccUseLdOpt])
=====================================
m4/fp_set_cflags_c99.m4
=====================================
@@ -0,0 +1,38 @@
+# FP_SET_CFLAGS_C99
+# ----------------------------------
+# figure out which CFLAGS are needed to place the compiler into C99 mode
+# $1 is name of CC variable (unmodified)
+# $2 is name of CC flags variable (augmented if needed)
+# $3 is name of CPP flags variable (augmented if needed)
+AC_DEFUN([FP_SET_CFLAGS_C99],
+[
+ dnl save current state of AC_PROG_CC_C99
+ FP_COPY_SHELLVAR([CC],[fp_save_CC])
+ FP_COPY_SHELLVAR([CFLAGS],[fp_save_CFLAGS])
+ FP_COPY_SHELLVAR([CPPFLAGS],[fp_save_CPPFLAGS])
+ FP_COPY_SHELLVAR([ac_cv_prog_cc_c99],[fp_save_cc_c99])
+ dnl set local state
+ CC="$$1"
+ CFLAGS="$$2"
+ CPPFLAGS="$$3"
+ unset ac_cv_prog_cc_c99
+ dnl perform detection
+ AC_PROG_CC_C99
+ fp_cc_c99="$ac_cv_prog_cc_c99"
+ case "x$ac_cv_prog_cc_c99" in
+ x) ;; # noop
+ xno) AC_MSG_ERROR([C99-compatible compiler needed]) ;;
+ *) $2="$$2 $ac_cv_prog_cc_c99"
+ $3="$$3 $ac_cv_prog_cc_c99"
+ ;;
+ esac
+ dnl restore saved state
+ FP_COPY_SHELLVAR([fp_save_CC],[CC])
+ FP_COPY_SHELLVAR([fp_save_CFLAGS],[CFLAGS])
+ FP_COPY_SHELLVAR([fp_save_CPPFLAGS],[CPPFLAGS])
+ FP_COPY_SHELLVAR([fp_save_cc_c99],[ac_cv_prog_cc_c99])
+ dnl cleanup
+ unset fp_save_CC
+ unset fp_save_CFLAGS
+ unset fp_save_cc_c99
+])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2a2db04b24a4654261db8e0db6ad7bac1b3d7cf
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b2a2db04b24a4654261db8e0db6ad7bac1b3d7cf
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230105/a6c3d168/attachment-0001.html>
More information about the ghc-commits
mailing list