The mapping of architectures to optimization flags is now retrieved from
Hardware::CPU and the selected flags are passed as an environmen
variable, rather than duplicated in the cc wrapper and re-calculated on
every invocation of the compiler.
ClosesHomebrew/homebrew#24540.
The cc wrapper's make_fuss is only enabled when HOMEBREW_CCCFG contains
'O', which is set by the make wrapper. This means it is disable when
running configure scripts. However, this does not include configure
scripts invoked by make, which inherit the value of HOMEBREW_CCCFG from
the make process. make_fuss will be enabled for these scripts, cause
breakage.
Configure scripts generated by autoconf 2.56 (November 2002) or later
export DUALCASE into the environment of subprocesses. This variable is
only used by the MKS shell, so we can use it as a heuristic to determine
if we are running as a subprocess of a configure script.
In 6e3a585607116d06f47aac2ff5a649f2898216f0 ("Improve superenv
add/remove message."), more debugging information was added to the
"make_fuss" output generated by the superenv compiler
wrapper.
This resulted in some breakage in configure scripts that inspect stderr,
so in e1bd9b9e980c433878e60833f09964b8ca996657 ("Don't use stderr for
make_fuss output."), the output was moved to stdout. This only appeared
to solve the problem, since stdout is buffered but stderr is not.
Later, in fb749e47509b77b5bd89e7b14f0a1097d4af7f40, Homebrew started
generating logs even in verbose mode. This had the side effect of moving
stdout/stderr from a TTY to a pipe, and thus stdout was no longer
line-buffered.
Since it was not line-buffered, and Ruby's internal buffers were not
flushed, the debug output was being lost. This was addressed in
2d5724af8613c820b8c14f4171fe1de6a17f10c3 ("cc: ensure wrapper output is
always flushed").
This caused stdout to be flushed during configure, which resurfaced the
original bug that prompted e1bd9b9e980c433878e60833f09964b8ca996657.
This was fixed by disabling the debug output during configure, in
f1779837a46a58520560fba3850a0e2992284d0a.
Since the original bug has been addressed in a more robust way, we can
move the debug output back to stderr.
FixesHomebrew/homebrew#23923.
* Add new ENV function for selecting stdlib for Clang.
- The selection is no-op for non-system-clang compilers.
- Both superenv and stdenv are handled.
* Add new HOMEBREW_CCCFG flag and ccwrapper handling.
* Add options and ENV method to specify building in C++11 mode.
- Set C++ compiler flags to enable C++11 mode.
- To add options to support C++11 mode, a formula can now use
option :cxx11
to provide "--c++11" option, and detect and enable C++11 support in
install method using
ENV.cxx11 if build.cxx11?
ClosesHomebrew/homebrew#22453.
This allows overriding the "oldest CPU" behaviour - for instance, to
build Intel bottles for a newer CPU than Core 2, to build a PPC bottle
with or without Altivec on the same computer, etc.
This sets cpp to use the compiler as cpp, and works with scripts which
pass values to cpp on stdin as well as with file arguments.
ClosesHomebrew/homebrew#22155.
This defines the new HOMEBREW_ARCHS environment variable, which is
currently only set during universal builds, so that the tool wrappers
no longer need to hardcode i386/x86_64.
Since 'gcc' is a symlink to 'llvm-gcc' on Xcode 4.3+, --use-gcc and
--use-llvm were doing exactly the same thing. Combined with the
previous commit, this allows users with either a leftover
/usr/bin/gcc-4.2 or a homebrewed apple-gcc42 to build with gcc.
This doesn't however fix Xcode-only systems with apple-gcc42.
FixesHomebrew/homebrew#17243.
Superenv normally filters out "-m32" flag, preventing 32bit builds.
Some software, however, still only work in 32bit mode.
If ENV.m32 is called, superenv does not filter out the "-m32" flag.
Also note, superenv, does not explicitly add the -m32 flag and
expects the build system of the software to know when and where to
provide this flag.
ClosesHomebrew/homebrew#16350.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
We already (correctly) allow -Wl, style linker arguments to pass
through; extend this to -Wp, (preprocessor) and -Wa, (assembler).
FixesHomebrew/homebrew#17252.
This allows Homebrew to be installed into /opt or /sw.
ClosesHomebrew/homebrew#15780.
Signed-off-by: Max Howell <mxcl@me.com>
Cleaned up the patch a little. Still ugly though, but logic is unusual so that's just how it is.