454 Commits

Author SHA1 Message Date
Xiyue Deng
6fc6dd791b stdenv: drop space between "-isystem" and path.
* This is consistent with superenv.
2013-11-02 01:47:35 -07:00
Mike McQuaid
d9d2443d5d Cleanup use of some global constants. 2013-10-30 13:20:48 -07:00
Xiyue Deng
ea2dd613a4 Make stdenv handling less intrusive.
* Don't encode "-Qunused-arguments", as this is only supported in Clang
  and will break building when C/C++ compiler is switched during the
  process, e.g. building gcc. The warning is harmless without
  "-Werror".
2013-10-27 06:30: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
Jack Nagel
c511d7d2f4 Add OS.mac? and OS.linux? 2013-10-18 12:56:51 -05:00
Misty De Meo
45e7f0ccb0 Allow older non-Apple GCCs to build things 2013-10-16 18:43:56 -07:00
Jack Nagel
31e0bf61fa Pathname: removed unused method alias 2013-10-14 22:05:30 -05:00
Misty De Meo
cb18dedce4 superenv: add gcc-4.0 to superenv 2013-10-13 19:00:33 -07:00
Mike McQuaid
19852bc47c 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
caa2f87728 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
fe31e8ddb4 Use MacOS.locate to find otool
Fixes Homebrew/homebrew#23111.
2013-10-07 21:32:18 -05:00
Misty De Meo
74ab023422 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
25ab8212a0 FileUtils#copy_metadata: update comment, version 2013-10-06 14:06:25 -07:00
Jack Nagel
43f0c63135 superenv: fix hardcoded X11 aclocal path 2013-10-04 21:06:19 -05:00
Jack Nagel
2bbe2dba16 ENV.x11: only use SDK when CLT is missing and X11 is from Apple 2013-10-04 21:06:18 -05:00
Jack Nagel
b2bb0e22f4 ENV.x11: always add include/freetype2 to CPPFLAGS 2013-10-04 21:06:18 -05:00
Jack Nagel
b35d9906e5 Pass the mktemp prefix as an argument 2013-10-02 22:01:31 -05:00
Jack Nagel
02a0e4e2e0 Fix mktemp directory naming 2013-10-02 19:41:05 -05:00
Misty De Meo
48dde74503 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
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
Jack Nagel
50d2f632d9 Allow partial installation of resources 2013-09-17 21:29:54 -05: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
84cbfb164e Open files in binary mode where appropriate 2013-09-16 12:50:31 -05:00
Adam Vandenberg
d4cf3ef212 Implement Resources
Closes Homebrew/homebrew#20212.
2013-09-11 22:05:26 -07:00
Jack Nagel
6d7cda77e9 ENV: remove trailing slash from OpenGL header path 2013-09-06 12:38:56 -05:00
Jack Nagel
7e079fc37d ENV: convert values to strings in cc setters 2013-09-03 10:07:53 -05:00
Jack Nagel
ce48366ab1 ENV: use cc accessor 2013-09-03 10:06:55 -05:00
Misty De Meo
96b50e013e 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
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
Mike McQuaid
98eac4226b Allow forcing bottle installation. 2013-09-01 12:59:01 +01:00
Adam Vandenberg
9dc8ddf054 Workaround for debrew
See Homebrew/homebrew#21720.
2013-08-31 11:15:19 -07:00
Jack Nagel
6b79a4e714 ENV: only set fortran flags in one place 2013-08-30 19:07:10 -05:00
Jack Nagel
8828187b4c ENV: use fc accessor 2013-08-30 19:00:19 -05:00
Jack Nagel
405ba3df68 Fix conditional in ENV.fortran 2013-08-30 18:59:58 -05:00
Jack Nagel
2cb8c443e4 ENV: use cflags setter 2013-08-30 18:42:12 -05:00
Jack Nagel
cc37943267 ENV: use cc accessor 2013-08-30 18:42:12 -05:00
Jack Nagel
aa79e21ba4 ENV: add cc and cxx setters 2013-08-30 18:42:12 -05:00
Jack Nagel
4bee5db66d Simplify handling custom FCFLAGS 2013-08-30 16:42:04 -05:00
Jack Nagel
43bd5d44c2 Remove PATH hack from ENV.fortran 2013-08-30 16:30:34 -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
Jack Nagel
fb50be432a Remove default values from ENV.{cc,cxx}
Closes Homebrew/homebrew#22138.
2013-08-29 19:22:36 -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
Jack Nagel
77056dc5cd Simplify condition 2013-08-26 22:11:29 -05:00