586 Commits

Author SHA1 Message Date
Misty De Meo
97bb9c5b73 stdenv: fix self.cc check
Since ENV.cc/cxx are accessors to ENV, any values being passed through
are coerced into strings, which means that a nil `ENV.cc` is actually
an empty string - which isn't considered to be false in Ruby.

Fixes mistydemeo/tigerbrew#161.
Fixes mistydemeo/tigerbrew#135.
2014-01-03 17:59:00 -08:00
Jack Nagel
b745d21912 superenv: don't accidentally filter out HOMEBREW_TEMP
Fixes Homebrew/homebrew#25471.
2013-12-27 13:01:41 -06:00
Steven Peters
b524943226 install: add --only-dependencies option
The traditional approach to installing the dependencies of a formula is
the following:

  brew install `brew deps formula`

This approach ignores any options that are specified in the parent
formula. This pull request adds a --only-dependencies option to brew
install that installs the dependencies of a formula with optional flags,
but returns before installing the parent formula.

Closes Homebrew/homebrew#25272.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2013-12-19 16:43:42 -06:00
Jack Nagel
c6c7b9b165 Extract HOMEBREW_TEMP constant 2013-12-14 09:35:58 -06:00
Jack Nagel
68f6936070 Move Pathname#dynamically_linked_libraries to mach module 2013-12-14 09:35:58 -06:00
Jack Nagel
00d0de5b24 Report correct file/line in backtraces for attr_rw methods 2013-12-12 14:20:46 -06:00
Adam Vandenberg
e523262dfa monkey around for emacs' code highlighter
The abv method has a construct that causes emacs to not highlight
the rest of pathname.rb, so move abv lower in the file.

Sorry.
2013-12-12 08:22:39 -08:00
Adam Vandenberg
7516cee374 +x wrapper scripts, so they work during post-install 2013-12-12 08:21:22 -08: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
65a00e213b Make CompilerSelectionError an InstallationError
Fixes Homebrew/homebrew#19962.
2013-12-03 22:16:37 -06:00
Jack Nagel
ea992b02e5 Fix typo 2013-12-02 01:16:50 -06:00
Jack Nagel
98f25e4407 Yielded value is not used 2013-12-02 00:16:48 -06:00
Adam Vandenberg
268feffae4 support .lz archives
Closes Homebrew/homebrew#24775.
2013-11-29 15:18:49 -08:00
Jack Nagel
0581532fdc Require Formula before using it 2013-11-27 17:30:21 -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
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