135 Commits

Author SHA1 Message Date
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
Dominyk Tiller
bfbdfe8d9d env/shared: ignore perl opts
In theory, letting these be set once wasn't an awful idea because it allows
users choice on where Perl modules end up.

In reality, as we've moved closer to sandboxing and at the same time accepted more
perl binding options into formulae it has been exposed as something of a hellraiser.

It's not that uncommon for Perl users to set a custom `INSTALL_BASE` in the ENV which
means we end up with quite a few formula that fail hard with this sort of error:

```
Only one of PREFIX or INSTALL_BASE can be given. Not both.
```

The other common error, which we discovered via sandboxing, is that the Perl modules
end up outside Homebrew's control which means we don't automatically remove them
when the package is removed. Sandboxing blocks this, which means when we eventually
move to enable that by default for users as well as CI it'll quickly become a
prominent issue.
2016-02-20 19:30:31 +00:00
Martin Afanasjew
8e4fad8969 ENV: avoid misleading Fortran setup warnings
Fixes Homebrew/homebrew#31156.
Closes Homebrew/homebrew#47246.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-23 06:54:04 +01:00
Dominyk Tiller
b331e03c39 env: add java_cache env 2015-12-18 23:32:56 +00: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
Xu Cheng
767d961824 ENV#userpaths!: ensure Superenv.bin and opt path come at first
This ensures that binaries in /usr/local/bin would not overwrite
superenv.

Closes Homebrew/homebrew#44376.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-28 21:47:04 +08:00
Misty De Meo
3bc2ff8e20 Accept "gcc" for --cc=gcc-5 even if not installed 2015-09-12 11:47:14 -07: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
Xu Cheng
ae0e270727 favor flat_map over map...flatten 2015-08-06 22:33:46 +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
5e7edbbd3c Ask the exception for the formula name 2015-06-22 21:08:27 -04:00
Jack Nagel
87e7735012 Ask the formula object for the opt path 2015-06-22 21:00:40 -04:00
Jack Nagel
f1bf81dd55 Simplify gcc_version_formula 2015-06-21 21:18:24 -04:00
Jack Nagel
1ce04786d6 Inline variable 2015-06-21 21:18:24 -04:00
Jack Nagel
3f11f1a0de Eliminate special case for core gcc 2015-06-21 21:18:24 -04:00
Jack Nagel
2db59be452 Less code in begin/rescue block 2015-06-21 21:18:23 -04:00
Jack Nagel
1bba5fd88a Pass full match to warn_about_non_apple_gcc 2015-06-21 21:18:23 -04:00
Jack Nagel
09f8c54f83 Move some constants from env to compiler constants 2015-06-19 21:38:39 -04:00
Jack Nagel
bf4dc7449b Clear GOPATH and GOROOT in build environment
Fixes Homebrew/homebrew#37936.
2015-05-14 20:04:45 -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
Viktor Szakats
fc2818b7a5 Use more https in urls and updated some lost links
Closes Homebrew/homebrew#35531.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2015-01-04 02:13:16 -05:00
Jack Nagel
6096ec9568 Unset LIBRARY_PATH before builds
See https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html

Closes Homebrew/homebrew-versions#592.
2014-12-17 14:40:05 -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
04dae13ae7 Replace CompilerQueue with predetermined priority lists 2014-09-18 15:50:54 -05:00
Jack Nagel
ae88549797 Remove fails_with? from the formula instance 2014-09-18 15:50:54 -05:00
Jack Nagel
b544f3e5f1 Clear GOBIN in environment setup
Closes Homebrew/homebrew#32014.
2014-09-07 18:39:00 -05:00
Jack Nagel
5a2ae61e66 Add another TODO 2014-08-03 15:28:51 -05:00
Jack Nagel
fded4d0385 Remove an is_a check 2014-08-03 10:47:47 -05:00
Jack Nagel
a5895ad1fe Check nil? || empty? instead of to_s.empty? 2014-07-18 11:43:37 -05:00
Jack Nagel
3439703c65 Drop pointless to_s call 2014-07-18 11:43:37 -05:00
Jack Nagel
fe0c018a1a No need to cache lookup that is only done once 2014-07-13 10:50:56 -05:00
Jack Nagel
32d84377d5 Move constants so we don't have to load all of ENV to get them 2014-07-02 21:58:43 -05:00
Jack Nagel
20d544085a Use a more descriptive variable name 2014-06-22 18:43:14 -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
4d9d01893e Move deprecated Formula class methods to compat
These have all been moved to Formulary.
2014-06-22 15:03:17 -05:00
Jack Nagel
6e616b29c5 Use a || b 2014-06-03 09:43:27 -05:00
Shaun Jackman
bd682d5519 Treat HOMEBREW_CC the same as --cc
Closes Homebrew/homebrew#29762.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-03 09:43:27 -05:00
Shaun Jackman
6e56009217 HOMEBREW_CC: Remove COMPILER_ALIASES
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2014-06-03 09:43:21 -05:00
Jack Nagel
6eb220d78f Share code for sanitizing ENV between both build environments 2014-05-26 14:10:24 -05:00
Jack Nagel
f6fda5651b Remove deprecated --use-{gcc,llvm,clang}
Closes Homebrew/homebrew#29380.
2014-05-19 10:37:45 -05:00
Jack Nagel
16c073a153 Remove hardcoded reference to ENV 2014-05-18 14:41:49 -05:00
Jack Nagel
930cf4c768 Add accessor for HOMEBREW_CC 2014-05-18 14:34:31 -05:00
Jack Nagel
ff9bbe941b ENV.cc= and ENV.cxx= are private 2014-05-18 14:34:31 -05:00
Jack Nagel
9e8d419070 Use a case statement 2014-05-18 14:23:45 -05:00
Jack Nagel
858da0063d Allow disabling arch flag filtering
Closes Homebrew/homebrew#17352.
2014-05-14 00:00:59 -05:00
Mike McQuaid
8c426e8207 ENV/shared: fix gcc versions edge case. 2014-05-06 22:17:59 +01:00
Mike McQuaid
c92a16e2ce shared: refactor gcc_version_formula.
Avoid throwing unnecessary exceptions by checking for paths existing and
creating formulae as late as possible. Additionally use instance
variables for some caching.
2014-05-06 16:45:50 +01:00
Mike McQuaid
1b0647d747 shared: don't use Formula.factory unnecessarily.
Instead check if the path exists by using opt.
2014-05-06 16:45:50 +01:00