[GHC] #8683: add "cpp program" and "cpp program options" to settings file
GHC
ghc-devs at haskell.org
Sun Jan 26 13:38:25 UTC 2014
#8683: add "cpp program" and "cpp program options" to settings file
-------------------------------------+------------------------------------
Reporter: carter | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.7
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets: #8439
-------------------------------------+------------------------------------
Comment (by trommler):
Replying to [comment:16 carter]:
OK, I see what the issue is:
> here an error from
> ./configure --with-gcc=clang --with-cpp=gcc
>
> (where i try to add the cpp flags to mk/config.in with a patch i've not
pushed yet)
>
> [...]
> with the associated log being
>
> {{{
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
>
> It was created by Haskell terminfo package configure 0.2, which was
> generated by GNU Autoconf 2.69. Invocation command line was
>
> $ ./configure --with-compiler=ghc CFLAGS= -m64 -fno-stack-protector
LDFLAGS= -m64 CPPFLAGS= -m64 -E -undef -traditional --with-cc=gcc
--with-gcc=/Users/carter/bin/gcc
>
> [...]
> configure:2413: checking whether the C compiler works
> configure:2435: gcc -m64 -fno-stack-protector -m64 -E -undef
-traditional -m64 conftest.c >&5
>[...]
> }}}
{{{$CPPFLAGS}}} will be used in compiler commands too. The compiler
command configure tests is something like {{{$CC $CFLAGS $CPPFLAGS
$LDFLAGS}}}.
{{{-E}}} must not be part of CPPFLAGS but CPP should be set to {{{$CC
-E}}} unless you specify the preprocessor ({{{/usr/bin/cpp}}} on my
system) directly. If you call the preprocessor through a compiler driver
like {{{gcc}}} or {{{clang}}} then {{{$CPP}}} should include the {{{-E}}}
flag. I think the user should be required to specify {{{--with-cpp="gcc
-E"}}} rather than {{{--with-cpp=gcc}}} and likewise for clang.
I'll prepare a new pull request.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8683#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list