664 Commits

Author SHA1 Message Date
Jack Nagel
dd06522815 Recognized .pax.gz extension 2013-11-14 16:20:25 -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
c7b7fdf0ca Simplify ENV.0x methods in stdenv 2013-11-12 13:53:29 -06:00
Jack Nagel
0b793e321e Add ENV.O0 to stdenv 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
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