summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac77
1 files changed, 68 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 9f0edaa663..34cc02e559 100644
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,7 @@ fi
AC_SUBST([CONFIGURE_ARGS], [$ac_configure_args])
dnl ----------------------------------------------------------
-dnl ** Find unixy sort and find commands,
+dnl ** Find unixy sort and find commands,
dnl ** which are needed by FP_SETUP_PROJECT_VERSION
dnl ** Find find command (for Win32's benefit)
@@ -91,7 +91,7 @@ AC_ARG_WITH([ghc],
WithGhc="$GHC"])
dnl ** Tell the make system which OS we are using
-dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something
+dnl $OSTYPE is set by the operating system to "msys" or "cygwin" or something
AC_SUBST(OSTYPE)
AC_ARG_ENABLE(bootstrap-with-devel-snapshot,
@@ -479,6 +479,64 @@ 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
+],
+[
+ if test "$HostOS" != "mingw32"
+ then
+ HaskellCPPCmd=$WhatGccIsCalled
+ fi
+]
+)
+
+
+
+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
+ ]
+)
+
+
dnl ** Which ld to use?
dnl --------------------------------------------------------------
FP_ARG_WITH_PATH_GNU_PROG([LD], [ld], [ld])
@@ -991,13 +1049,14 @@ echo ["\
Using $CompilerName : $WhatGccIsCalled
which is version : $GccVersion
Building a cross compiler : $CrossCompiling
-
- ld : $LdCmd
- Happy : $HappyCmd ($HappyVersion)
- Alex : $AlexCmd ($AlexVersion)
- Perl : $PerlCmd
- dblatex : $DblatexCmd
- xsltproc : $XsltprocCmd
+ cpp : $HaskellCPPCmd
+ cpp-flags : $HaskellCPPArgs
+ ld : $LdCmd
+ Happy : $HappyCmd ($HappyVersion)
+ Alex : $AlexCmd ($AlexVersion)
+ Perl : $PerlCmd
+ dblatex : $DblatexCmd
+ xsltproc : $XsltprocCmd
Using LLVM tools
llc : $LlcCmd