Skip to content
  • Rodrigo Mesquita's avatar
    5ffc7d7b
    Configure CPP into settings · 5ffc7d7b
    Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
    There is a distinction to be made between the Haskell Preprocessor and
    the C preprocessor. The former is used to preprocess Haskell files,
    while the latter is used in C preprocessing such as Cmm files.
    
    In practice, they are both the same program (usually the C compiler) but
    invoked with different flags.
    
    Previously we would, at configure time, configure the haskell
    preprocessor and save the configuration in the settings file, but,
    instead of doing the same for CPP, we had hardcoded in GHC that the CPP
    program was either `cc -E` or `cpp`.
    
    This commit fixes that asymmetry by also configuring CPP at configure
    time, and tries to make more explicit the difference between HsCpp and
    Cpp (see Note [Preprocessing invocations]).
    
    Note that we don't use the standard CPP and CPPFLAGS to configure Cpp,
    but instead use the non-standard --with-cpp and --with-cpp-flags.
    The reason is that autoconf sets CPP to "$CC -E", whereas we expect the
    CPP command to be configured as a standalone executable rather than a
    command. These are symmetrical with --with-hs-cpp and
    --with-hs-cpp-flags.
    
    Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP
             to be C99 compatible through -optP, since we now configure that
             into settings.
    
    Closes #23422
    5ffc7d7b
    Configure CPP into settings
    Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
    There is a distinction to be made between the Haskell Preprocessor and
    the C preprocessor. The former is used to preprocess Haskell files,
    while the latter is used in C preprocessing such as Cmm files.
    
    In practice, they are both the same program (usually the C compiler) but
    invoked with different flags.
    
    Previously we would, at configure time, configure the haskell
    preprocessor and save the configuration in the settings file, but,
    instead of doing the same for CPP, we had hardcoded in GHC that the CPP
    program was either `cc -E` or `cpp`.
    
    This commit fixes that asymmetry by also configuring CPP at configure
    time, and tries to make more explicit the difference between HsCpp and
    Cpp (see Note [Preprocessing invocations]).
    
    Note that we don't use the standard CPP and CPPFLAGS to configure Cpp,
    but instead use the non-standard --with-cpp and --with-cpp-flags.
    The reason is that autoconf sets CPP to "$CC -E", whereas we expect the
    CPP command to be configured as a standalone executable rather than a
    command. These are symmetrical with --with-hs-cpp and
    --with-hs-cpp-flags.
    
    Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP
             to be C99 compatible through -optP, since we now configure that
             into settings.
    
    Closes #23422
Loading