Commit 555eef1d authored by thomie's avatar thomie Committed by Austin Seipp

Remove RAWCPP_FLAGS (Task #9094)

Reviewers: carter, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D648

GHC Trac Issues: #9094
parent 49d99ebf
......@@ -2146,7 +2146,7 @@ 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]])],
[Path to the (C) preprocessor for Haskell files [default=autodetect]])],
[
if test "$HostOS" = "mingw32"
then
......@@ -2157,6 +2157,8 @@ AC_ARG_WITH(hs-cpp,
],
[
# We can't use $CPP here, since HS_CPP_CMD is expected to be a single
# command (no flags), and AC_PROG_CPP defines CPP as "/usr/bin/gcc -E".
HS_CPP_CMD=$WhatGccIsCalled
SOLARIS_GCC_CPP_BROKEN=NO
......@@ -2198,7 +2200,7 @@ 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]])],
[Flags to the (C) preprocessor for Haskell files [default=autodetect]])],
[
if test "$HostOS" = "mingw32"
then
......@@ -2210,11 +2212,11 @@ AC_ARG_WITH(hs-cpp-flags,
[
$HS_CPP_CMD -x c /dev/null -dM -E > conftest.txt 2>&1
if grep "__clang__" conftest.txt >/dev/null 2>&1; then
HS_CPP_ARGS="-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs "
HS_CPP_ARGS="-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs"
else
$HS_CPP_CMD -v > conftest.txt 2>&1
if grep "gcc" conftest.txt >/dev/null 2>&1; then
HS_CPP_ARGS="-E -undef -traditional "
HS_CPP_ARGS="-E -undef -traditional"
else
$HS_CPP_CMD --version > conftest.txt 2>&1
if grep "cpphs" conftest.txt >/dev/null 2>&1; then
......
......@@ -269,7 +269,7 @@ compiler_CPP_OPTS += ${GhcCppOpts}
define preprocessCompilerFiles
# $0 = stage
compiler/stage$1/build/primops.txt: compiler/prelude/primops.txt.pp compiler/stage$1/$$(PLATFORM_H)
$$(CPP) $$(RAWCPP_FLAGS) -P $$(compiler_CPP_OPTS) -Icompiler/stage$1 -x c $$< | grep -v '^#pragma GCC' > $$@
$$(HS_CPP) -P $$(compiler_CPP_OPTS) -Icompiler/stage$1 -x c $$< | grep -v '^#pragma GCC' > $$@
compiler/stage$1/build/primop-data-decl.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE)
"$$(genprimopcode_INPLACE)" --data-decl < $$< > $$@
......
......@@ -426,8 +426,13 @@ export CC
MAYBE_OVERRIDE_STAGE0([gcc],[CC_STAGE0])
MAYBE_OVERRIDE_STAGE0([ar],[AR_STAGE0])
dnl ** figure out how to invoke the C preprocessor (i.e. `gcc -E`)
AC_PROG_CPP
# --with-hs-cpp/--with-hs-cpp-flags
FP_CPP_CMD_WITH_ARGS(HaskellCPPCmd, HaskellCPPArgs)
AC_SUBST([HaskellCPPCmd])
AC_SUBST([HaskellCPPArgs])
dnl ** Which ld to use?
dnl --------------------------------------------------------------
......@@ -596,9 +601,6 @@ FPTOOLS_SET_C_LD_FLAGS([target],[CONF_CC_OPTS_STAGE2],[CONF_GCC_LINKER_OPTS_STAG
FP_GCC_EXTRA_FLAGS
dnl ** figure out how to invoke cpp directly (gcc -E is no good)
AC_PROG_CPP
AC_SUBST(CONF_CC_OPTS_STAGE0)
AC_SUBST(CONF_CC_OPTS_STAGE1)
AC_SUBST(CONF_CC_OPTS_STAGE2)
......@@ -1031,14 +1033,14 @@ echo ["\
Using $CompilerName : $WhatGccIsCalled
which is version : $GccVersion
Building a cross compiler : $CrossCompiling
cpp : $HaskellCPPCmd
cpp-flags : $HaskellCPPArgs
ld : $LdCmd
Happy : $HappyCmd ($HappyVersion)
Alex : $AlexCmd ($AlexVersion)
Perl : $PerlCmd
dblatex : $DblatexCmd
xsltproc : $XsltprocCmd
hs-cpp : $HaskellCPPCmd
hs-cpp-flags : $HaskellCPPArgs
ld : $LdCmd
Happy : $HappyCmd ($HappyVersion)
Alex : $AlexCmd ($AlexVersion)
Perl : $PerlCmd
dblatex : $DblatexCmd
xsltproc : $XsltprocCmd
Using LLVM tools
llc : $LlcCmd
......
......@@ -65,6 +65,8 @@ export CC
# --with-hs-cpp/--with-hs-cpp-flags
FP_CPP_CMD_WITH_ARGS(HaskellCPPCmd, HaskellCPPArgs)
AC_SUBST([HaskellCPPCmd])
AC_SUBST([HaskellCPPArgs])
dnl ** Which ld to use?
dnl --------------------------------------------------------------
......
......@@ -623,18 +623,11 @@ ArSupportsAtFile_STAGE3 = $(ArSupportsAtFile)
CONTEXT_DIFF = @ContextDiffCmd@
CP = cp
# It's not easy to separate the CPP program from its flags, as
# AC_PROG_CPP defines CPP as "/usr/bin/gcc -E"
CPP = @CPP@ @CPPFLAGS@
#
# RAWCPP_FLAGS are the flags to give to cpp (viz, gcc -E) to persuade it to
# behave plausibly on Haskell sources.
#
# Clang in particular is a bit more annoying, so we suppress some warnings.
RAWCPP_FLAGS = -undef -traditional
ifeq "$(CC_CLANG_BACKEND)" "1"
RAWCPP_FLAGS += -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs
endif
HS_CPP = @HaskellCPPCmd@ @HaskellCPPArgs@
FIND = @FindCmd@
......
......@@ -16,7 +16,7 @@ $(call trace, manual-package-config($1))
$(call profStart, manual-package-config($1))
$1/dist/package.conf.inplace : $1/package.conf.in $$$$(ghc-pkg_INPLACE) | $$$$(dir $$$$@)/.
$$(CPP) $$(RAWCPP_FLAGS) -P \
$$(HS_CPP) -P \
-DTOP='"$$(TOP)"' \
$$($1_PACKAGE_CPP_OPTS) \
-x c $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) $$< -o $$@.raw
......@@ -29,7 +29,7 @@ $1/dist/package.conf.inplace : $1/package.conf.in $$$$(ghc-pkg_INPLACE) | $$$$(d
# "make install", so we declare it as phony
.PHONY: $1/dist/package.conf.install
$1/dist/package.conf.install: | $$$$(dir $$$$@)/.
$$(CPP) $$(RAWCPP_FLAGS) -P \
$$(HS_CPP) -P \
-DINSTALLING \
-DLIB_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))"' \
-DINCLUDE_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))/include"' \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment