Skip to content
  • Herbert Valerio Riedel's avatar
    Drop Xcode 4.1 hack and fix ignored CC var issue · ffc802e8
    Herbert Valerio Riedel authored
    Xcode 4.1 was released back in 2011 for Mac OSX 10.6/10.7.
    However, OSX 10.7 reached EOL sometime around the end of 2014.
    So this `--with-gcc-4.2` hack shouldn't be needed anymore.
    
    Moreover, this patch changes ./configure to honor the CC env-var
    again (and thus fix #11231) while giving `--with-gcc=...` a higher
    priority over `CC=...`.
    
    So the following 3 invocations are equivalent now:
    
      CC=... ./configure
      ./configure CC=...
      ./configure --with-gcc=...
    
    Since `--with-{gcc,clang}=...` is a misnomer (as is made apparent by
    `--with-gcc=clang` or `--with-clang=gcc`), this would give us a neutral
    and idiomatic way to tell ./configure which C compiler to use.
    
    Moreover, `./configure --help` says at the end of its output:
    
      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.
    
    Consequently, by honoring CC=... (rather than ignoring it) we increase
    consistency and reduce user confusion. Ideally, CC=... would become the
    recommended way to set the C compiler, and `--with-{clang,gcc}=...`
    would be demoted to legacy aliases.
    
    Reviewed By: erikd, bgamari
    
    Differential Revision: https://phabricator.haskell.org/D2046
    ffc802e8