147 Commits

Author SHA1 Message Date
cadrpear
f43bb0c292 Fix building universal binaries on 32-bit CPUs
[jn: style, update comment]

Closes Homebrew/homebrew#25728.
Fixes Homebrew/homebrew#26834.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-02-19 14:15:03 -05:00
Jack Nagel
a1d2aa0f69 Stop exporting HOMEBREW_VERBOSE to build environment
This flag no longer affects the output of the compiler wrappers, since
everything is buffered by the build process rather than each individual
tool.

Additionally, this is a user-facing knob that affects ARGV.verbose?, and
the combination of these two issues broke the --quieter feature.
2014-02-18 21:46:26 -05:00
Misty De Meo
b7781c4571 Revert "Add python superenv wrapper"
This reverts commit 90e22e389c539b25fe7864645bfe5e2a9ce7452f.
2014-01-27 20:46:04 -08:00
Misty De Meo
ee76cf75af Add python superenv wrapper
Closes Homebrew/homebrew#26140.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2014-01-26 10:55:49 -08:00
Jack Nagel
8f89db4882 Fix typo 2014-01-11 21:28:25 -06:00
Jack Nagel
b745d21912 superenv: don't accidentally filter out HOMEBREW_TEMP
Fixes Homebrew/homebrew#25471.
2013-12-27 13:01:41 -06:00
Jack Nagel
5e0a8668fb Silence more warnings 2013-12-09 15:15:53 -06:00
Jack Nagel
009541c446 Help autoconf find m4 on Xcode-only systems
Closes Homebrew/homebrew#24904.
2013-12-06 20:56:46 -06:00
Jack Nagel
14b19ba3c4 Adjust optimization flags if the CPU does not support SSE4
Tentatively fixes Homebrew/homebrew#21778, Homebrew/homebrew#24363.
2013-11-27 17:25:27 -06:00
Jack Nagel
f89c8bbaf9 Remove comment 2013-11-21 17:13:37 -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
c020950a42 Export HOMEBREW_PREFIX to build environment
Constructing the path relative to a file in the repository is incorrect
on some supported configurations (i.e., the repository is located in a
different place than the prefix).

Closes Homebrew/homebrew#24418.
2013-11-17 22:57:16 -06:00
Jack Nagel
b1f8358fa8 Combine X11 path conditionals 2013-11-15 21:25:43 -06:00
Jack Nagel
ba0cfd3582 Improve heuristic for detecting configure 2013-11-15 00:40:17 -06:00
Jack Nagel
7fc9ffec86 Better documentation for no-op superenv methods 2013-11-12 13:53:29 -06:00
Jack Nagel
4cb824b92e Allow changing the optimization level under superenv 2013-11-12 13:53:29 -06:00
Jack Nagel
83cbb1e3fb Group public ENV methods together 2013-11-11 18:34:15 -06:00
Jack Nagel
c95c32fbb0 Remove outdated comment 2013-11-11 18:32:56 -06:00
Jack Nagel
e7f20bcfbc superenv: fix type error
This is a string since it is used to match string keys in a hash.
2013-11-08 23:15:12 -06:00
Mike McQuaid
8484e72f75 superenv: set cc/cxx based on actual compiler.
Closes Homebrew/homebrew#23449.
2013-11-07 12:06:03 +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
Mike McQuaid
d9d2443d5d Cleanup use of some global constants. 2013-10-30 13:20:48 -07: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
Jack Nagel
27f7e3503f Move verbose ENV setup out of brew.rb 2013-10-19 10:41:09 -05:00
Jack Nagel
805472946b Rename MacOS to OS::Mac 2013-10-18 12:56:51 -05:00
Misty De Meo
cb18dedce4 superenv: add gcc-4.0 to superenv 2013-10-13 19:00:33 -07:00
Jack Nagel
43f0c63135 superenv: fix hardcoded X11 aclocal path 2013-10-04 21:06:19 -05:00
Misty De Meo
497ccdc41c ENV: Ensure @compiler is set
If @compiler isn't set/checked by ENV.compiler and the ENV.clang/etc.
methods, ENV.compiler may return unexpected results after fails_with
picks a fallback compiler.

See Homebrew/homebrew#22674.
2013-09-19 23:36:15 -07:00
Misty De Meo
51a487de18 superenv: don't set CC in ENV.clang/etc.
These methods were overriding CC and causing superenv to potentially
skip the compiler wrapper - especially if no wrapper existed for the
compiler being used, e.g. GNU GCCs.

Closes Homebrew/homebrew#22443.
Fixes Homebrew/homebrew#22249.
Fixes Homebrew/homebrew#22424.
Fixes Homebrew/homebrew#22506.
Fixes Homebrew/homebrew#22521.
Fixes Homebrew/versions#207.
2013-09-17 12:47:07 -07:00
Misty De Meo
1ae81f0bf7 Move CompilerSelector logic into build env setup
This moves the CompilerSelector fails_with logic into the build
environment setup, making the compiler selection available before
performing actions that depends on knowing what the compiler is, e.g.
setting up PATH.

ENV.setup_build_environment now optionally takes a Formula argument
to provide the information necessary to do the fails_with, and the new
ENV.validate_cc! extracts the fails_with logic from Build.install.
2013-09-17 12:43:38 -07:00
Jack Nagel
6d7cda77e9 ENV: remove trailing slash from OpenGL header path 2013-09-06 12:38:56 -05:00
Misty De Meo
ef1d9c0cd0 Implement fails_with for non-Apple compilers
This adds support for non-Apple GCC compilers in the fails_with code.
A fails_with block for a non-Apple compiler looks like:

fails_with :gcc => '4.8.1' do
  cause 'Foo'
end

Non-Apple compilers don't have build numbers, so compiler failures are
based on version strings instead.

Internally non-Apple compilers can be distinguished because they are
passed around as strings instead of symbols.

In addition, this alters the priority list for compilers, with the
following changes:

* Apple GCC 4.2 and LLVM-GCC swap positions, with GCC now taking
  priority. (Maybe LLVM-GCC should just go away.)
* Non-Apple GCC compilers are ranked below GCC 4.2 but above LLVM-GCC
  and Apple GCC 4.0.
2013-09-01 13:19:13 -07:00
Misty De Meo
71268b7f16 Provide reusable GNU GCC constants in ENV 2013-09-01 13:19:13 -07:00
Misty De Meo
11f8b2f49c Experimental support for non-Apple GCCs 2013-09-01 13:19:12 -07:00
Adam Vandenberg
9dc8ddf054 Workaround for debrew
See Homebrew/homebrew#21720.
2013-08-31 11:15:19 -07:00
Jack Nagel
aa79e21ba4 ENV: add cc and cxx setters 2013-08-30 18:42:12 -05:00
Misty De Meo
7e1af4b7d5 Unify compiler selection logic
This unifies the logic for selecting a compiler between superenv and
stdenv. A variation of superenv's `determine_cc`, which now returns a
symbol, has been moved into the shared ENV extension. Stdenv uses the
result of this directly (as it's always used symbols), while superenv
translates that back into a compiler string.

This also has the effect of disabling HOMEBREW_USE_(gcc|llvm|clang) in
stdenv, which have already been marked as deprecated for some time, and
enables the HOMEBREW_CC= environment variable syntax from superenv in
stdenv.
2013-08-30 07:52:13 -07:00
Misty De Meo
221bb2419f Add --cc= syntax for selecting compilers 2013-08-30 07:52:12 -07: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
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
Misty De Meo
3cf3fa7d8f superenv: fix CC value for ENV.gcc
'gcc' could refer to anything of llvm-gcc, clang, or gcc-4.0 on
various Xcode versions.
2013-08-22 22:42:54 -07:00
Jack Nagel
ea8f51256b Use ENV.append_path 2013-08-19 17:21:13 -05:00
Amos Wenger
52ace99f14 Use File::PATH_SEPARATOR globally instead of ':'
On Unix, the path separator is ':', whereas on Windows,
it is ';'. This is the first of a series of patch to bring
macbrew's and winbrew's codebases closer together.

The main places the magic constant ':' was being used were:
  - the $PATH environment variable
  - CMAKE-related environment variables
  - pkg-config related environment variables

Closes Homebrew/homebrew#21921.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-08-19 13:35:44 -05:00
Jack Nagel
9a5b15bb61 Move common ENV methods to a shared module 2013-08-19 12:32:59 -05:00
Jack Nagel
cc18f5e0c4 Move superenv.rb to extend/ENV/super.rb 2013-08-19 12:32:59 -05:00