diff options
author | Karel Gardas <karel.gardas@centrum.cz> | 2014-08-17 23:26:39 +0200 |
---|---|---|
committer | Karel Gardas <karel.gardas@centrum.cz> | 2014-08-17 23:26:40 +0200 |
commit | 2d42564ac9ffe768f21078e40886fd066f87d1c3 (patch) | |
tree | 6b45864740da2138443c59b45f9e8468752d6001 /configure.ac | |
parent | 96d04186e00fe2202b9953688492bb370d818bf1 (diff) | |
download | haskell-2d42564ac9ffe768f21078e40886fd066f87d1c3.tar.gz |
workaround Solaris 11 GNU C CPP issue by using GNU C 3.4 as CPP
Summary:
Solaris 11 distributed GNU C 4.5.x is configured in a way that its
CPP is not working well while invoked from GHC. GHC runs it with
-x assembler-with-cpp and in this particular configuration GNU C CPP
does not provide any line-markers so GHC's output of errors or warnings
is confusing since it points to preprocessed file in /tmp and not
to the original Haskell file. Fortunately old GNU C 3.4.x is still
provided by the OS and when installed it'll be used automatically
as GHC CPP which is whole logic of this patch. So although we use modern
GCC as a C compiler and assembler we use old GCC as a C preprocessor.
Test Plan: validate
Reviewers: austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D151
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 56 |
1 files changed, 2 insertions, 54 deletions
diff --git a/configure.ac b/configure.ac index 378578a50b..a065b31255 100644 --- a/configure.ac +++ b/configure.ac @@ -484,60 +484,8 @@ export CC MAYBE_OVERRIDE_STAGE0([gcc],[CC_STAGE0]) MAYBE_OVERRIDE_STAGE0([ar],[AR_STAGE0]) -dnl ** what cpp to use? -dnl -------------------------------------------------------------- -AC_ARG_WITH(hs-cpp, -[AC_HELP_STRING([--with-hs-cpp=ARG], - [Use ARG as the path to cpp [default=autodetect]])], -[ - if test "$HostOS" = "mingw32" - then - AC_MSG_WARN([Request to use $withval will be ignored]) - else - HaskellCPPCmd=$withval - fi -], -[ - HaskellCPPCmd=$WhatGccIsCalled -] -) - - - -dnl ** what cpp flags to use? -dnl ----------------------------------------------------------- -AC_ARG_WITH(hs-cpp-flags, - [AC_HELP_STRING([--with-hs-cpp-flags=ARG], - [Use ARG as the path to hs cpp [default=autodetect]])], - [ - if test "$HostOS" = "mingw32" - then - AC_MSG_WARN([Request to use $withval will be ignored]) - else - HaskellCPPArgs=$withval - fi - ], -[ - $HaskellCPPCmd -x c /dev/null -dM -E > conftest.txt 2>&1 - if grep "__clang__" conftest.txt >/dev/null 2>&1; then - HaskellCPPArgs="-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs " - else - $HaskellCPPCmd -v > conftest.txt 2>&1 - if grep "gcc" conftest.txt >/dev/null 2>&1; then - HaskellCPPArgs="-E -undef -traditional " - else - $HaskellCPPCmd --version > conftest.txt 2>&1 - if grep "cpphs" conftest.txt >/dev/null 2>&1; then - HaskellCPPArgs="--cpp -traditional" - else - AC_MSG_WARN([configure can't recognize your CPP program, you may need to set --with-hs-cpp-flags=FLAGS explicitly]) - HaskellCPPArgs="" - fi - fi - fi - ] -) - +# --with-hs-cpp/--with-hs-cpp-flags +FP_CPP_CMD_WITH_ARGS(HaskellCPPCmd, HaskellCPPArgs) dnl ** Which ld to use? dnl -------------------------------------------------------------- |