Skip to content

GHC's configure script does not honour CC env var

./configure --help tells us that:

...

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <glasgow-haskell-bugs@haskell.org>.

However, neither

  • CC=clang-3.8 ./configure, nor
  • ./configure CC=clang-3.8

has any effect. ./configure keeps using the /usr/bin/gcc in $PATH.

The only invocation that has the desired effect is

  • ./configure --with-gcc=clang-3.8

However, this is utterly surprising and confusing to experienced developers who are used to Autoconf ./configure scripts adhering to the conventions regarding CC, and contradicts the --help message.

Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Build System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information