Commit Graph
47 Commits
Author SHA1 Message Date
Jack Nagel 2ddef27e1b Move verbose ENV setup out of brew.rb 2013-10-19 10:41:09 -05:00
Jack Nagel 3cba7d44c6 Rename MacOS to OS::Mac 2013-10-18 12:56:51 -05:00
Jack Nagel 1d0a7c66a5 Add OS.mac? and OS.linux? 2013-10-18 12:56:51 -05:00
Misty De Meo c72c9e1da9 Allow older non-Apple GCCs to build things 2013-10-16 18:43:56 -07:00
Misty De Meo 6e0c8ef3e0 superenv: add gcc-4.0 to superenv 2013-10-13 19:00:33 -07:00
Jack Nagel 1f973c3084 superenv: fix hardcoded X11 aclocal path 2013-10-04 21:06:19 -05:00
Jack Nagel 97858c672c ENV.x11: only use SDK when CLT is missing and X11 is from Apple 2013-10-04 21:06:18 -05:00
Jack Nagel 6d4dc72a23 ENV.x11: always add include/freetype2 to CPPFLAGS 2013-10-04 21:06:18 -05:00
Misty De Meo 7b6b09c95d Move ld64 into SharedEnvExtension
Superenv is being tested on Xcode 3.1.4, so this needs to be supported
in both ENVs, not just stdenv.
2013-09-28 17:22:27 -07:00
Misty De Meo 9dcf69d494 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 #22674.
2013-09-19 23:36:15 -07:00
Misty De Meo a5fedcd7c8 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 #22443.
Fixes #22249.
Fixes #22424.
Fixes #22506.
Fixes #22521.
Fixes Homebrew/versions#207.
2013-09-17 12:47:07 -07:00
Misty De Meo 045aadb860 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 0ce0f36620 ENV: remove trailing slash from OpenGL header path 2013-09-06 12:38:56 -05:00
Jack Nagel aec24de852 ENV: convert values to strings in cc setters 2013-09-03 10:07:53 -05:00
Jack Nagel e505c33f11 ENV: use cc accessor 2013-09-03 10:06:55 -05:00
Misty De Meo 3bfccca97c Remove HOMEBREW_CC warning from ENV.compiler
ENV.compiler is called outside setting up the build environment, where
values unsupported for user input might have been specified - for
example, GNU GCC executables.
2013-09-01 14:42:37 -07:00
Misty De Meo 733076ec22 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 512801cd26 Provide reusable GNU GCC constants in ENV 2013-09-01 13:19:13 -07:00
Misty De Meo 5a5ed17dc5 Experimental support for non-Apple GCCs 2013-09-01 13:19:12 -07:00
Adam Vandenberg 1b82fc4e06 Workaround for debrew
See #21720.
2013-08-31 11:15:19 -07:00
Jack Nagel ae6f542ff7 ENV: only set fortran flags in one place 2013-08-30 19:07:10 -05:00
Jack Nagel 1545e6eeac ENV: use fc accessor 2013-08-30 19:00:19 -05:00
Jack Nagel c26cf238b7 Fix conditional in ENV.fortran 2013-08-30 18:59:58 -05:00
Jack Nagel 797c037c3a ENV: use cflags setter 2013-08-30 18:42:12 -05:00
Jack Nagel 2028b2ef6d ENV: use cc accessor 2013-08-30 18:42:12 -05:00
Jack Nagel 32b6c04019 ENV: add cc and cxx setters 2013-08-30 18:42:12 -05:00
Jack Nagel 5a7edf2562 Simplify handling custom FCFLAGS 2013-08-30 16:42:04 -05:00
Jack Nagel fd9bff9ac6 Remove PATH hack from ENV.fortran 2013-08-30 16:30:34 -05:00
Misty De Meo 3020f71958 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 4834418af3 Add --cc= syntax for selecting compilers 2013-08-30 07:52:12 -07:00
Jack Nagel a950e35286 Remove default values from ENV.{cc,cxx}
Closes #22138.
2013-08-29 19:22:36 -05:00
Misty De Meo 3a948bfc21 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
Jack Nagel 9977ff8c60 Simplify condition 2013-08-26 22:11:29 -05:00
Jack Nagel a8cdb00e52 Only perform coercion to string once in ENV.{append,prepend} 2013-08-26 15:03:37 -05:00
Misty De Meo bb6e76e58f 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 585d7c6e65 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 #20233.
Fixes #17984.
Fixes #22078.
2013-08-23 11:36:03 -05:00
Misty De Meo a5a3116fae 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 d911acbde2 Use ENV.prepend_path 2013-08-19 17:21:13 -05:00
Jack Nagel 79e06fc9ea Use ENV.append_path 2013-08-19 17:21:13 -05:00
Jack Nagel 068ad2b738 Add ENV.append_path 2013-08-19 17:21:13 -05:00
Jack Nagel eaeded4b2a Fix typo 2013-08-19 14:07:14 -05:00
Amos Wenger 13c2776795 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 #21921.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-08-19 13:35:44 -05:00
Jack Nagel ccf8f2789b Remove ENV.expand_xcrun
This method is currently unused and after inspecting the git history, it
appears it may never have been used at all.
2013-08-19 12:34:14 -05:00
Jack Nagel a1ce0dba12 More robust implementation of ENV.with_build_environment 2013-08-19 12:32:59 -05:00
Jack Nagel c0f5d3aa01 Rename HomebrewEnvExtension to Stdenv 2013-08-19 12:32:59 -05:00
Jack Nagel c4f7f6f155 Move common ENV methods to a shared module 2013-08-19 12:32:59 -05:00
Jack Nagel c183f14b2e Move superenv.rb to extend/ENV/super.rb 2013-08-19 12:32:59 -05:00