221 Commits

Author SHA1 Message Date
Xu Cheng
c8d814f907
ENV/super: use Hardware::CPU.is_32_bit?
`Hardware.is_32_bit?` is deprecated.
2016-08-17 22:13:30 +08:00
Mike McQuaid
2e747aa910 super: remove effective_sysroot.
No longer needed in `super.rb` after it was moved to `os/mac`.
2016-07-15 08:10:25 +01:00
Dominyk Tiller
91af4aa0fe
super: migrate xml2 cmake to mac/super
Looks like it was accidentally left behind (?)
2016-07-15 05:23:28 +01:00
Dominyk Tiller
bd4e24ae8f
superenv: restore HOMEBREW_PREFIX/lib 2016-07-13 01:18:42 +01:00
Mike McQuaid
0d189fae57 superenv: port to generic OS. (#457) 2016-07-12 12:01:20 +01:00
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01:00
msbit
01e8e180a8 ENV: mark gcc-6 as supporting C++11 (#349)
Add SharedEnvExtension#gcc_with_cxx11_support? to centralise the
logic for checking whether a compiler is known to support C++11.

Update logic to accept GCC 4.8 and above (including 6). Thereby also
address oversight in #163 where support for GCC 6 was added without
updating the C++11 compiler whitelist.

Add tests for Superenv#cxx11.

Closes #346.
2016-06-16 14:15:28 +02:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00
Andrew Janke
36b2af2e0f superenv: fix formula prefix path to consider revisions
Old logic doesn't include revision. This fixes that, and passes the
whole formula prefix path to avoid duplicating the path-construction
logic.

Closes #80.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-13 10:41:01 -04:00
Andrew Janke
a8ed06ba74 superenv: allow paths under self's keg
Fixes build error in Homebrew/homebrew-core#100.

Closes #63.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-13 02:20:17 -04:00
Misty De Meo
4fd5c5c159 superenv: filter -I/-L paths on dependencies
Previously, superenv did not try to filter -I or -L flags
based on the list of requested dependencies; as a result, buildsystems
which opportunistically discover Homebrew-installed libraries were able
to link against them even under superenv.

This adds a list of all requested dependencies to the superenv environment,
and compares all -I and -L flags against those; any Cellar and opt paths
found which resolve to unrequested dependencies are filtered out.
2016-04-04 15:30:22 -07:00
ilovezfs
45e138ffc6 Xcode 7 MACOSX_DEPLOYMENT_TARGET and SDK fixes
SDK 10.10 isn't something that exists for Xcode 7, so stop looking for
it and rely on MACOSX_DEPLOYMENT_TARGET instead.

See PR Homebrew/homebrew#50137 Yosemite build failure

Closes Homebrew/homebrew#50355.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-03-31 13:16:50 +08:00
Xu Cheng
ce7b32cec8 add HOMEBREW_ENV_PATH internal variable
`Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It
should be able to be accessed during the `brew tests`.

By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these
codes.
2016-03-21 19:07:38 +08:00
Tim D. Smith
fe37cc5271 Revert "Avoid constructing paths by string interpolation"
This reverts commit 8c7f3d859e8f715b6c63e4fe75e7a636aee4167f.
2016-03-19 19:14:50 +08:00
Tim D. Smith
87781f2a37 Avoid constructing paths by string interpolation
Closes Homebrew/homebrew#50154.
2016-03-19 19:14:50 +08:00
ilovezfs
1e1184fc2d superenv: fix make_jobs regular expression
HOMEBREW_MAKE_JOBS can be a multidigit number. The regex should match
the entire number not just the last digit.

Closes Homebrew/homebrew#50016.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2016-03-13 14:32:05 +08:00
Ryan Hendrickson
8ce81af67a ENV: warn_if_universal_binaries_not_supported
Raise an error when attempting to create universal binaries with a GCC
that can't do so.

Closes Homebrew/homebrew#46630.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-10 11:23:11 +01:00
Misty De Meo
5ecf3113a8 superenv: set SDKROOT, MACOSX_DEPLOYMENT_TARGET 2015-12-07 13:17:43 -08:00
Xu Cheng
06806f860d remove unnecessary require statements 2015-10-18 22:57:42 +08:00
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
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07: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
Tim D. Smith
6606c7b53b Revert "work around missing __debug header in Xcode CLT 6.3"
Ding, dong, the witch is dead...

This reverts commit fd5ca9ba16f5afc181364369210cb94e997a5a5e.

Ref Homebrew/homebrew#38514, Homebrew/homebrew#38735.

Closes Homebrew/homebrew#41843.
2015-08-15 20:24:20 -07:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +08: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
7edf3c88f6 Pass formula objects, not strings, into the build environment 2015-06-18 23:13:48 -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
Ryan Hendrickson
798711cade Use canonical representation of the superenv bin directory
The xcrun script should be skipping the ENV directory when it scans
$PATH looking for tools to run. Unfortunately, the script compares the
paths found to the real path of the ENV directory (following symlinks),
but superenv was adding the nominal path to $PATH, not following
symlinks. As a consequence, platforms with Xcode < 4.3 would get into
infinite loops when trying to call non-system versions of gcc, as xcrun
calls the ENV version of gcc-X.X which calls xcrun and so on forever.

This commit changes superenv to follow symlinks when determining the bin
path to use.

Fixes Homebrew/homebrew#33731.
Closes Homebrew/homebrew#40062.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-05-25 22:01:12 -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
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
2fb9890e07 Don't use deprecated API 2015-04-20 20:49:55 -04:00
Tim D. Smith
af57cffeb0 work around missing __debug header in Xcode CLT 6.3
uses the LLVM 3.6 debug header from:
http://reviews.llvm.org/diffusion/L/browse/libcxx/tags/RELEASE_360/final/include/__debug

Workaround for Homebrew/homebrew#38514.

Closes Homebrew/homebrew#38735.
2015-04-19 13:41:26 -07:00
Jack Nagel
f438af9915 Don't prune cellar paths when cellar is in /opt
Fixes Homebrew/homebrew#35382.
2015-02-07 13:54:33 -05:00
Jack Nagel
a955665102 Preserve backtrace from original exception 2014-12-29 15:23:01 -05:00
Jack Nagel
cb09660516 Always set sysroot for Xcode-only systems
Fixes Homebrew/homebrew#33431.
2014-10-29 11:03:54 -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
1c5995776f The build environment should only deal with strings 2014-09-11 16:50:56 -05:00
Jack Nagel
b0c1e5f7d6 Fix redefinition of x11 reader method in superenv 2014-08-24 14:32:10 -05:00
Camillo Lugaresi
4001c6f8f1 stop Xcode tools from overriding deps when CLT is not installed
Closes Homebrew/homebrew#30641.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-07-03 16:25:59 -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
191e588212 Stop caching Superenv.bin
It is not a hotspot and causes an ordering dependency in the tests.
2014-06-10 17:50:33 -05:00
Jack Nagel
c90247aa44 Place X11 ahead of OpenGL when X11 is active
Fixes Homebrew/homebrew#29651.
2014-05-28 09:23:36 -05:00
Jack Nagel
6eb220d78f Share code for sanitizing ENV between both build environments 2014-05-26 14:10:24 -05:00
Jack Nagel
d69be7f619 Add ENV.m64 to superenv 2014-05-22 09:18:34 -05:00
Jack Nagel
d61615890f Fix ENV.m32 under superenv 2014-05-22 09:18:34 -05:00
Jack Nagel
b894d6e246 Set sysroot for non-clang compilers on 10.9
Although the correct sysroot is built into Apple's tools on 10.9, we
need to continue setting it for custom compilers.
2014-05-19 14:41:03 -05:00
Jack Nagel
613292e3ce Reorganize superenv include and library path setup
I found the dual use of CMAKE_*_PATH variables to make it difficult to
reason about this code. Now a separate set of variables are used to
communicate with the cc wrapper, and less work is performed in the
wrapper itself.

We no longer pass the SDK include path as a -isystem directory on
Xcode-only setups. Doing so is redundant with `--sysroot` and has other
side effects, namely changing the include path search order, which can
break compilation of some software (e.g. qemu).

On Xcode-only 10.9, we can additionally omit `--sysroot`, as the correct
paths are built into the tools.

A new variable, HOMEBREW_SYSROOT, is used to this information to the
wrapper. It will be unset on Xcode-only 10.9. HOMEBREW_SDKROOT will
continue to be set, as it is used for other things besides setting the
include search path.
2014-05-19 14:41:02 -05:00
Jack Nagel
930cf4c768 Add accessor for HOMEBREW_CC 2014-05-18 14:34:31 -05:00