121 Commits

Author SHA1 Message Date
Jack Nagel
de9b1845e0 Remove uses of -no-cpp-precomp 2013-11-20 15:02:04 -06:00
Jack Nagel
0a236abe53 Simplify passing archflags to cc wrapper 2013-11-20 13:19:14 -06:00
Jack Nagel
e0d2492247 Move optimization flag selection out of cc wrapper
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.

Closes Homebrew/homebrew#24540.
2013-11-20 13:19:06 -06:00
Jack Nagel
e4da435995 Remove outdated TODOs 2013-11-17 22:17:14 -06:00
Jack Nagel
f465c781d8 Write debug log in non-verbose mode 2013-11-17 19:09:24 -06:00
Jack Nagel
aec457bb7c Replace error-prone superenv debug ouput with a separate log file 2013-11-17 19:04:21 -06:00
Jack Nagel
ba0cfd3582 Improve heuristic for detecting configure 2013-11-15 00:40:17 -06:00
Jack Nagel
4cb824b92e Allow changing the optimization level under superenv 2013-11-12 13:53:29 -06:00
Jack Nagel
74673633c0 Extract optflags method from cflags method 2013-11-12 13:53:29 -06:00
Jack Nagel
16d2429703 Extract archflags method from cflags method 2013-11-12 13:53:29 -06:00
Jack Nagel
e22ad69f00 Only pass cflags during configure and make
Fixes Homebrew/homebrew#24172.
2013-11-11 12:15:57 -06:00
Jack Nagel
42b54150af Pass optimization and arch flags during configure
Closes Homebrew/homebrew#24106.
2013-11-10 18:25:33 -06:00
Jack Nagel
43baf49ff1 Extract cxxflags method from cflags method 2013-11-10 18:24:49 -06:00
Bulat Shakirzyanov
1f1678a1d5 superenv: fix versioned g++ invocations.
Closes Homebrew/homebrew#24104.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-11-09 09:56:37 +00:00
Jack Nagel
06dbec5aaf Disable make_fuss when running configure invoked by make
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.
2013-11-04 11:02:18 -06:00
Jack Nagel
b1d78cf642 Move superenv make_fuss output back to stderr
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.

Fixes Homebrew/homebrew#23923.
2013-11-03 20:19:54 -06:00
Jack Nagel
a0a341c297 cc: disable make_fuss during configure
Fixes Homebrew/homebrew#23885.
2013-11-02 00:43:17 -05:00
Jack Nagel
8ce3a9f168 cc: ensure wrapper output is always flushed 2013-11-01 23:16:17 -05:00
Xiyue Deng
15e5fe4384 Clang standard library selection.
* 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.
2013-10-26 22:17:04 -07:00
Xiyue Deng
f2132c47bd C++11 support.
* 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?

Closes Homebrew/homebrew#22453.
2013-10-26 22:17:04 -07:00
Xiyue Deng
862e6ca3bc Don't use stderr for make_fuss output.
* Using stderr breaks some configure script which fails due to contents
  available in stderr.
2013-10-20 06:44:05 -07:00
Misty De Meo
110859c08d superenv: always respect HOMEBREW_CC
Closes Homebrew/homebrew#23322.
2013-10-19 23:17:05 -07:00
Xiyue Deng
3b66a7d4fd Improve superenv add/remove message.
* Now it includes all flags that are added or removed by superenv when
  passing "--verbose" or envvar VERBOSE or HOMEBREW_VERBOSE is set.
2013-10-18 13:11:50 -07:00
Misty De Meo
11f8b2f49c Experimental support for non-Apple GCCs 2013-09-01 13:19:12 -07:00
Jack Nagel
41ac74524d Don't duplicate -E argument in ccE mode 2013-08-31 11:14:38 -05:00
Jack Nagel
803a408b1d Differentiate between "cpp" and "cc-E" modes 2013-08-31 10:43:24 -05:00
Jack Nagel
773ed20476 Reorder cc wrapper modes by frequency 2013-08-31 10:38:34 -05:00
Jack Nagel
d61d054eac superenv: fix no-op system path filtering 2013-08-29 19:08:22 -05:00
Misty De Meo
c58d707158 Allow building bottles with custom architectures
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.
2013-08-28 20:21:06 -07:00
Misty De Meo
8a99ea2094 superenv: also filter out -mcpu=
On PPC, -mcpu is the preferred equivalent to -march.
2013-08-28 20:01:58 -07:00
Misty De Meo
a39ba39688 Revert "superenv: fix cpp shim"
This reverts commit dca89db55189a34f1c02d3f12a84eda8d81fd6d1.
2013-08-27 18:31:57 -07:00
Misty De Meo
55654933f5 superenv: fix cpp shim
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.

Closes Homebrew/homebrew#22155.
2013-08-27 18:24:08 -07:00
Misty De Meo
f0bf64e1e9 superenv: support PPC bottles
Allows for building bottles on PPC both with and without Altivec.
This is currently not active but will be enabled once superenv is
stable on Leopard.
2013-08-25 14:51:48 -07:00
Jack Nagel
84369dd949 Always pass -headerpad_max_install_names to the linker
We use install_name_tool pretty liberally, so we need to take steps to
ensure libraries and executables are always linked with this flag.

Closes Homebrew/homebrew#20233.
Fixes Homebrew/homebrew#17984.
Fixes Homebrew/homebrew#22078.
2013-08-23 11:36:03 -05:00
Jack Nagel
1bcd428b8e Fix superenv arch flag handling
Fixes Homebrew/homebrew#21943.
2013-08-16 20:46:03 -05:00
Misty De Meo
1586a69879 superenv: use Hardware::CPU.universal_archs
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.
2013-08-15 22:46:57 -07:00
Misty De Meo
0845341de3 cc: delegate cpp to the real tool, not compiler
Fixes Homebrew/homebrew#21527.
2013-07-30 18:41:27 -07:00
Misty De Meo
0430589fbc superenv cc: specify llvm-g++-4.2
We previously tried to call llvm-g++ under the name `g++`,
but this is now a link to clang on Xcode 5+.

Fixes Homebrew/homebrew#20691.
2013-06-27 14:56:47 -05:00
Misty De Meo
d212b360ec superenv: Improve compiler selection
This fixes superenv on Xcode 3.2.6, and also fixes C++ software with
gcc-4.2 on all Xcodes.
2013-05-27 12:56:25 -05:00
Mike McQuaid
ad5c1b81cd Fix --build-bottle CFLAGS.
The CFLAGS were previously not generic enough.

References Homebrew/homebrew#18944.
References Homebrew/homebrew#19179.
2013-05-11 12:18:25 +01:00
Samuel John
261ca7aa6a superenv: Filter out -isysroot
Closes Homebrew/homebrew#16576.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-03-29 11:10:18 -07:00
Jack Nagel
21b583ba46 -std, not --std 2013-03-07 22:42:42 -06:00
Jack Nagel
df1d27b037 superenv/cc: keep exec monkeypatch out of Object 2013-03-06 17:06:07 -06:00
Jack Nagel
4adf0b0f69 superenv/cc: make file loadable 2013-03-06 17:06:07 -06:00
Misty De Meo
2e23e9a22d superenv: --use-gcc should specify gcc-4.2
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.

Fixes Homebrew/homebrew#17243.
2013-01-26 22:57:56 -06:00
Samuel John
293be41d5c superenv: Allow ENV.m32 (for 32bit builds)
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.

Closes Homebrew/homebrew#16350.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-24 19:21:57 -08:00
Jack Nagel
8135ed6528 superenv: allow -W[alp], style arguments to pass through
We already (correctly) allow -Wl, style linker arguments to pass
through; extend this to -Wp, (preprocessor) and -Wa, (assembler).

Fixes Homebrew/homebrew#17252.
2013-01-23 00:18:01 -06:00
Max Howell
2446e5ee8a dels -> dups typo
/cc @samueljohn
2012-11-13 11:18:19 -05:00
Xiyue Deng
6762780f3e Whitelist Homebrew's own prefix in superenv.
This allows Homebrew to be installed into /opt or /sw.

Closes Homebrew/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.
2012-11-01 09:51:41 -04:00
Adam Vandenberg
e502728641 Superenv: be more specific about -O flags
Closes Homebrew/homebrew#15775.
2012-10-31 06:50:50 -07:00