68 Commits

Author SHA1 Message Date
Mike McQuaid
2c959a7d58 More API documentation.
And remove the documented stuff from the `example-formula.rb`.

Closes Homebrew/homebrew#43241.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-29 15:43:16 +01:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
add guard in Formula#file_modified? to prevent git popup

add guard in Superenv.bin before calling MacOS::Xcode.version

add guard against missing Xcode/CLT in Xcode.uncached_version

return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior

checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well

needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation

MacOS.can_build? becomes MacOS.has_apple_developer_tools?
2015-08-21 11:02:33 -07:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
1bba5fd88a Pass full match to warn_about_non_apple_gcc 2015-06-21 21:18:23 -04:00
Jack Nagel
aad4ed7faa Undocument return value of ENV.deparallelize
It's not clear whether it returns MAKEFLAGS with or without -j<n>, and
neither is particularly useful behavior, given you can easily get the
exact value by calling ENV["MAKEFLAGS"]. So let's not commit to this
API.
2015-06-12 20:14:07 -04:00
なつき
3649b31765 ENV: Add gcc-5 to compilers support C++11
Closes Homebrew/homebrew#39758.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-16 11:16:55 -04:00
なつき
6181a786c0 compilers: support gcc 5
Closes Homebrew/homebrew#39470.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-08 22:23:30 -04:00
Misty De Meo
f5d6d80d5b ENV.deparallelize: add block form for temporary change
Closes Homebrew/homebrew#39026.
2015-04-25 12:45:31 -07:00
Jack Nagel
318c103802 Remove unnecessary encoding comments
These files do not contain any non-ASCII characters.
2015-01-03 23:44:26 -05:00
Jack Nagel
662f887e9a Call reset in the superclass implementation of setup_build_environment 2014-09-18 16:44:20 -05:00
Jack Nagel
c5f2f6b539 Make --cc override the compiler selector 2014-09-18 15:50:54 -05:00
Jack Nagel
28c1c4ee15 Use only strings in ENV.x11 2014-09-11 16:56:21 -05:00
Jack Nagel
1c5995776f The build environment should only deal with strings 2014-09-11 16:50:56 -05:00
Jack Nagel
c98fe91f13 Don't directly assign Pathname objects to environment variables
Fixes Homebrew/homebrew#32234.
2014-09-11 16:50:56 -05:00
Jack Nagel
00220c40db Don't overwrite optimization flag map in ENV.clang 2014-08-18 16:02:53 -05:00
Jack Nagel
e0f86a1a86 Pull effective arch detection into a method 2014-08-09 14:57:09 -05:00
Jack Nagel
9f6bd0798f Use opt_bin 2014-08-06 20:52:36 -05:00
Jack Nagel
0fda322e0e Use Pathname#split 2014-06-22 18:38:30 -05:00
Shaun Jackman
42c20b0979 Move the compiler-selecting methods to ENV/shared
Closes Homebrew/homebrew#30210.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-22 18:30:15 -05:00
Jack Nagel
6eb220d78f Share code for sanitizing ENV between both build environments 2014-05-26 14:10:24 -05:00
Mike McQuaid
2fb6d2fdbe ENV/std: use full paths to gcc versions.
This is consistent with how e.g. `gcc-4.2` is handled.

This means e.g. `ghc` can find `gcc-4.8` at runtime.

Fixes Homebrew/homebrew#28934.
2014-05-06 16:45:50 +01:00
Jack Nagel
4b335eb2df Xcode-only path adjustments should be the same in both environments 2014-05-01 18:36:46 -05:00
Jack Nagel
71055aa073 Move xctoolchain_path to Xcode module, where it belongs 2014-05-01 18:36:46 -05:00
Jack Nagel
259bbdf76c Drop obsolete compiler fallback in stdenv
This code originated in a slightly different form in 8e88b22fd1ec65a344ce6e4facd6dad4b415b2ad:

8e88b22fd1/Library/Homebrew/extend/ENV.rb (L30-L32)

Back then, MacOS.default_compiler could return nil, which meant
ENV.compiler could do the same. This code was carried forward as the
surrounding code changed. At this point it should be unreachable.
2014-04-29 21:11:03 -05:00
Jack Nagel
b6a0b95380 Use MacOS.locate and delete wrong comment 2014-04-29 01:31:22 -05:00
Jack Nagel
0de7f98b58 Remove comment that no longer reflects adjacent code 2014-04-29 01:31:22 -05:00
Jack Nagel
bfde04ee17 We don't use -Qunused-arguments anymore 2014-04-29 00:11:54 -05:00
Jack Nagel
90c03ffc17 ENV.{cc,cxx} setters already set OBJC and OBJCXX 2014-04-29 00:09:07 -05:00
Jack Nagel
6a2fa253cd Make ENV.O4 a no-op
On older Apple compilers "-O4" is known to cause build errors. On recent
clang, it's the same as "-O3" and you have to pass "-O3 -flto" to get
the old behavior.
2014-04-29 00:09:07 -05:00
Mike McQuaid
55d277c335 Support core GCC formula as a GCC compiler.
It is activated by the same mechanism as the Homebrew/versions compilers
which now check if the GCC formula uses the same, correct version.

References Homebrew/homebrew#28418.
2014-04-23 08:10:48 +01:00
Misty De Meo
0ec7e39287 Add ENV.refurbish_args helper
Rationale: our arg refurbishment is normally only turned on when
called via the `make` wrapper, for compatibility reasons. However,
there are numberous places we'd like this to be turned on elsewhere,
like software that builds via `python setup.py` where bad flags from
the system python can be pulled in.

This helper appends 'O' to CCCFG, which enables refurbishment for
all calls of the compiler shims.
2014-03-28 17:02:14 -07:00
Mike McQuaid
f155b0570e Revert "ENV: request no byte code Python when bottling."
This reverts commit b603c96276cf7fe1417d2355eebc47fb15da0b8c.
2014-03-08 00:04:30 +00:00
Mike McQuaid
536430e0ae ENV: request no byte code Python when bottling. 2014-03-02 02:08:59 +00:00
Misty De Meo
51d8270abd ENV.gcc: remove raise
This raise happened in no other ENV methods, and isn't really necessary
since fails_with guards against this method actually being called unless
gcc-4.2 is actually installed.
2014-01-04 01:22:04 -08:00
Misty De Meo
d7a6161751 Recommit ENV changes 2014-01-04 01:20:56 -08:00
Mike McQuaid
3cf2cc853d Revert "stdenv: fix self.cc check"
This reverts commit 0e1d52c0d3945ae0ac69383c7734e425b7fbf8f1.
2014-01-04 09:14:28 +00:00
Mike McQuaid
1dcf726a59 Revert "stdenv: set correct compiler symbol for gcc 4.0"
This reverts commit f4dc5614953b3b90acc28c83262d56587b0616b1.
2014-01-04 09:14:25 +00:00
Misty De Meo
bdd2e71b3a stdenv: set correct compiler symbol for gcc 4.0 2014-01-03 19:13:35 -08:00
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
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
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
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
Xiyue Deng
6fc6dd791b stdenv: drop space between "-isystem" and path.
* This is consistent with superenv.
2013-11-02 01:47:35 -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
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
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