Commit Graph
449 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
Jack Nagel 576b5c66dc Pathname: removed unused method alias 2013-10-14 22:05:30 -05:00
Misty De Meo 6e0c8ef3e0 superenv: add gcc-4.0 to superenv 2013-10-13 19:00:33 -07:00
Mike McQuaid f4d29a0494 Pathname: add cp_path_sub method.
This method allows copying a file to a new location by performing a
substitution on the pathname.
2013-10-10 16:46:47 +01:00
Mike McQuaid 8db4a6c18d InstallRenamed: don't overwrite etc files; rename.
If an etc file exists on installation instead of overwriting it (or
requiring all the manual checks in formula) simply copy it with the
extension `.default` appended.
2013-10-10 16:46:47 +01:00
Jack Nagel b4ba775003 Use MacOS.locate to find otool
Fixes #23111.
2013-10-07 21:32:18 -05:00
Misty De Meo 52af93123a Only track C++ stdlibs for C++ code
After a formula is built, scan all mach-o files for dynamic links
to see if any of them point to a C++ stdlib (libc++ or libstdc++).
If one of them is linked, record that information in the formula's tab.

This replaces the old behaviour where all files were assumed to be C++
code, and stdlibs were always tracked regardless of whether they were
actually linked against.

This also modifies the way that tabs are written - now tabs are written
with the stdlib field null, and values are only written if an stdlib
is detected.
2013-10-06 19:26:06 -07:00
Misty De Meo d53c9659fc FileUtils#copy_metadata: update comment, version 2013-10-06 14:06:25 -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
Jack Nagel d4cea4f1b6 Pass the mktemp prefix as an argument 2013-10-02 22:01:31 -05:00
Jack Nagel ed40bfe497 Fix mktemp directory naming 2013-10-02 19:41:05 -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
Jack Nagel 2178b33dde Allow partial installation of resources 2013-09-17 21:29:54 -05: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 e2554ccbe9 Open files in binary mode where appropriate 2013-09-16 12:50:31 -05:00
Adam Vandenberg b37bbbfc31 Implement Resources
Closes #20212.
2013-09-11 22:05:26 -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
Mike McQuaid 20115155cf Allow forcing bottle installation. 2013-09-01 12:59:01 +01: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