Commit Graph
52 Commits
Author SHA1 Message Date
Samuel John 13321d52b5 superenv: Work if build tool changes DEVELOPER_DIR
Some build systems still set the DEVELOPER_DIR to /Developer
and then nothing works any more (xcrun, xcodebuild etc.)
I am looking at you MacVim.
2013-06-03 17:29:43 +02:00
Misty De Meo b1a636c649 superenv: find Homebrew's gcc-4.2
If we're using a homebrewed gcc-4.2, xcrun may fail to find it (or,
worse, find superenv's shim instead). Explicitly add it to the PATH and
search all path elements for the requested tool.

Also make sure to specify 'gcc-4.2' as the compiler name, not plain
'gcc'. That can resolve to llvm-gcc and to gcc-4.0 on various Xcodes.
2013-06-02 14:44:27 -05:00
Misty De Meo 08523d9158 superenv: Improve compiler selection
This fixes superenv on Xcode 3.2.6, and also fixes C++ software with
gcc-4.2 on all Xcodes.
2013-05-27 12:56:25 -05:00
Mike McQuaid 646150ade9 Fix --build-bottle CFLAGS.
The CFLAGS were previously not generic enough.

References #18944.
References #19179.
2013-05-11 12:18:25 +01:00
Max Howell 02a0ddfa3e Add an alias to gmake in superenv
I had a luarock explicitly look ONLY for gmake, FFS.

This should be safe.
2013-04-09 13:58:32 -04:00
Samuel John ab562b50b2 superenv: Filter out -isysroot
Closes #16576.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-03-29 11:10:18 -07:00
Samuel John 06935cd77d Better superenv support for Xcode elsewhere
- The Library/ENV/4.3/xcrun shim now respects
  ENV['DEVELOPER_DIR'] instead assuming the location
  of /Applications/Xcode.app/Contents/Developer.
- The env var DEVELOPER_DIR is set if it is not
  already. So, during superenv this var is always set
  and we no longer have to care about people with unset
  or wrongly set xcode-select stuff. This has been
  a major PITA in the past.
- determine_developer_dir (which is used to set
  the DEVELOPER_DIR var) now uses MacOS::Xcode.prefix
  which is proven and very capable and uses splotlight
  correctly.
- Replace (and remove) MacSystem.xcode43_developer_dir
  with Xcode.prefix

Closes #18618
2013-03-21 17:10:32 +01:00
Jack Nagel f1a93ffc1c -std, not --std 2013-03-07 22:42:42 -06:00
Jack Nagel a1c8e6a960 superenv/cc: keep exec monkeypatch out of Object 2013-03-06 17:06:07 -06:00
Jack Nagel dc7650fced superenv/cc: make file loadable 2013-03-06 17:06:07 -06:00
mbcoguno 34c3da2de8 Contributions: fix soft link that not refer current file.
a6324cb forget fix soft link in ENV folder, it cause superenv
use Apple provided git and svn.

Closes #17927.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-02-18 18:29:03 +00:00
Adam Vandenberg 1e76bdf0f4 xcrun: remove suggestion that doesn't work
Closes #17443.
2013-02-05 11:22:47 -08:00
Misty De Meo eb80cd17bc superenv: --use-gcc should specify gcc-4.2
Since 'gcc' is a symlink to 'llvm-gcc' on Xcode 4.3+, --use-gcc and
--use-llvm were doing exactly the same thing. Combined with the
previous commit, this allows users with either a leftover
/usr/bin/gcc-4.2 or a homebrewed apple-gcc42 to build with gcc.

This doesn't however fix Xcode-only systems with apple-gcc42.

Fixes #17243.
2013-01-26 22:57:56 -06:00
Misty De Meo 032bfcdd85 xcrun: actually try fallbacks
xcrun has a lot of fallbacks if the first case fails but never actually
reaches them on CLT systems since it doesn't check the validity of the
first path before executing it.

(When should it reach these? Mainly for non-Xcode compilers we
support, e.g. apple-gcc42 which can be found by xcrun but which isn't
in /usr/bin)

The xcrun invocation also needed chomping.
2013-01-26 22:53:29 -06:00
Samuel John b5905e14af superenv: Allow ENV.m32 (for 32bit builds)
Superenv normally filters out "-m32" flag, preventing 32bit builds.
Some software, however, still only work in 32bit mode.

If ENV.m32 is called, superenv does not filter out the "-m32" flag.
Also note, superenv, does not explicitly add the -m32 flag and
expects the build system of the software to know when and where to
provide this flag.

Closes #16350.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-24 19:21:57 -08:00
Jack Nagel b82c96b085 superenv: allow -W[alp], style arguments to pass through
We already (correctly) allow -Wl, style linker arguments to pass
through; extend this to -Wp, (preprocessor) and -Wa, (assembler).

Fixes #17252.
2013-01-23 00:18:01 -06:00
Adam Vandenberg 3e1ec41bf9 superenv: make HOMEBREW_FILE available
Superenv scripts have a stripped PATH, which may not include
the brew binary itself. Make this explicitly available to
superenv scripts.

Fixes bsdmake wrapper.

Closes #16805.
Closes #16846.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-01-03 09:14:36 -08:00
Max Howell 4546a2ee01 dels -> dups typo
/cc @samueljohn
2012-11-13 11:18:19 -05:00
Max Howell b1a9d53e55 superenv: Builds need to use the right git/svn too
stdenv already works as Contributions/cmds is in the path already.

This is safe to do because OS X already has git and svn in the PATH if you have the CLT installed. So we should definitely ensure we use the right versions.

Fixes #15783.
2012-11-02 09:34:25 -04:00
Xiyue Deng f979e31f5d Whitelist Homebrew's own prefix in superenv.
This allows Homebrew to be installed into /opt or /sw.

Closes #15780.

Signed-off-by: Max Howell <mxcl@me.com>

Cleaned up the patch a little. Still ugly though, but logic is unusual so that's just how it is.
2012-11-01 09:51:41 -04:00
Adam Vandenberg 91db14b010 Superenv: be more specific about -O flags
Closes #15775.
2012-10-31 06:50:50 -07:00
Max Howell 0c9388938f Use cc -E, not cpp -E. Fixes #15402. 2012-10-28 10:52:06 -04:00
Max Howell 4e4517caa2 Restore HOMEBREW_LOG functionality 2012-09-29 09:57:37 -04:00
Max Howell 44e6db11cf Determine SUPERBIN correctly 2012-09-25 11:31:56 -04:00
Max Howell 1fc68c62d8 Clean up and improve build-error output and logs
All logs are now stored from each command executed in Formula.install.

Error output is truncated to five lines in an attempt to not overwhelm the user and to encourage users to read the error output and report the bug properly. Maybe we can get that figure up from 70% to 90%.
2012-09-25 11:31:56 -04:00
Max Howell 557cf057ec Abort if xcrun -find foo returns superbin/foo
Fixes #14691.

Rewrite in Ruby to facilitate checking PATHs properly.
2012-09-24 09:49:53 -04:00
Max Howell 35b415489b Puts build-tool args first
build-tool provided args must be considered first by cc, etc. Generally this already occurred for -I flags, because most of our -I flags were -isystem. However it didn't occur for keg-only flags and -L paths.

This was an error.

I amended the refurbishment code to ensure any paths we want to control the order of are thoroughly scrubbed out of the build-tool provided args. This ensures reliability for our builds.

However this path-scrubbing should always occur, even during configure (I am fairly sure of this). So more work is required.

Fixes #14781.
2012-09-14 11:55:59 -04:00
Max Howell e5916e8923 Make xcrun wrapper search /usr/bin too
The usual xcrun would, and this wrapper exists to also work around broken xcode-select paths.
2012-09-13 17:00:02 -04:00
Max Howell 23f7a06a77 Support c99/c89 compiles properly
We can't really execute c89/99 explicitly as these POSIX compliant tools support very few args. Best to execute clang or gcc with the --std=cx9 argument appended.

Fixes #14724.
2012-09-13 11:30:11 -04:00
Max Howell dcd2fdb845 Look harder for bsdmake
bsdmake used to be keg-only, so some users still have it unlinked (presumably they never run brew-doctor). Even though there is code to abort if dependencies are unlinked, it appears broken for this case. So let's just be thorough anyway.

Closes #14751.
2012-09-13 11:28:31 -04:00
Max Howell 1b727835de Fixes universal builds; Fixes #14845 2012-09-13 08:53:35 -04:00
Max Howell 6b67e2908b superenv: More thorough scrubbing of -I & -L args
It's important that -I is scrubbed thoroughly as we add most of our important paths with -isystem and -I is handled *first*.

NOTE this indicates we should probably have used -I rather than -isystem, but too late to test all that now.

Also scrub -L for bad-paths thoroughly (evaluate realpath).
2012-09-03 15:12:32 -04:00
Max Howell 330a6239ef Fix linking against X11 cairo in preference to ours
Amateur mistake where I forgot that the system library path is read AFTER the -L library path, so /usr/local/lib was after /opt/X11/lib and the wrong cairo was used.

This only affects CLT /usr/local installs with XQuartz installed.

Fixes #14639.
2012-09-03 15:12:31 -04:00
Max Howell 9f99535d31 Set CC and CXX with superenv (again)
It was dumb to have make call different compilers to configure depending on the `servile?` flag. This is not a route to reliability.

Instead now we set CC (formula that break if CC is set like Jack be damned, their build-systems are just plain broken and should not be supported). When cc is called we examine HOMEBREW_CC, otherwise we instantiate the tool that was called, just like the formula's build-system will expect.

Fixes #14659 (though the build fails later for me, with the same error for stdenv and superenv).
2012-09-03 15:12:31 -04:00
Max Howell 083229f777 Remove -fopenmp *and* -lgomp
Apparently LLVM can use these, so only remove if clang.

Refs #14569.
2012-09-02 23:10:06 -04:00
Max Howell f3f30340d7 bsdmake is *not* provided by Xcode/CLT
Fixes #14626.

Also make proctools install do prefixes other than /usr/local.
2012-09-02 11:22:12 -04:00
Max Howell 9aa5520b53 Add mig tool to superenv
Necessary because it otherwise calls actual cc after it does whatever it does. So we force it to call our cc.
2012-09-01 23:18:28 -04:00
Max Howell 2aa7f6466c superenv wrappers for c89 and c99
Fixes #14584.
2012-08-31 15:59:05 -04:00
Max Howell eab09fc267 Cram GL headers and includes into superenv
Fixes #14554.

We justify doing this because pre 10.8 X11 came with GL for all Homebrew-capable systems and as such is a default that we'd prefer not to have to address.
2012-08-31 14:12:28 -04:00
Max Howell 3309109b48 Always make fuss
It's only visible if you specify -v or builds fail, so let's help people to diagnose superenv issues.
2012-08-31 13:29:46 -04:00
Max Howell 43608eb163 Remove -fopenmp, fix pixman
Possibly this is not wise, but with -fopenmp -lgomp is automatically added by the toolchain, and I didn't have -lgomp.

Ideally we'd detect when this will work and then leave it in there.

/cc @sharpie @mikemcquaid @jacknagel
2012-08-31 13:29:46 -04:00
Max Howell 49ccb55af0 superenv fix for broken 10.8 apr-1-config
serf requires you to explicitly tell it where to find the supertool because otherwise it has a hardcoded /usr/bin/apr-1-config (:P), ctail however is sensible and searches the PATH so now it's as though we do nothing special in that formula. Nice.
2012-08-31 13:29:45 -04:00
Max Howell 4dbce44218 Refs #14558. Try to find tools when xcrun fails. 2012-08-31 10:22:11 -04:00
Max Howell 0cf83d1849 Remove plain "-O" 2012-08-31 10:22:11 -04:00
Max Howell 470c44dfa8 Consider superenv “servile” during configure
superenv defaults to servile mode. In servile mode:

* If 'gcc' is called, then 'gcc' is run (we ignore HOMEBREW_CC)
* CFLAGS (optimizations) are not applied
* ARGV is not mangled (TODO though we should apply fixes)
* -I and -L environment is still forcibly inserted.

This fixes, eg. jack which was still broken with stdenv. Jack was broken because we set CC in stdenv, and Jack has a stupid build-system. Unsetting CC allowed Jack to find and use the gcc tool it so demanded, but (previously) we would then substitute clang under its nose. The configure still failed. In servile mode (llvm-)gcc is used and Jack compiles.

In normal circumstances clang would then be inserted again during the make phase. But Jack uses the niche-wag build tool that we don't support for setting the O HOMEBREW_CCCFG flag that disables servile mode.
2012-08-31 10:22:10 -04:00
Max Howell 7aa496efed Fixes #14542; ocaml superenv issues
This patch removes most of the settings for CC, CXX etc. because we are trying to be minimal. Then we force the compiler to Homebrew's choice underneath in superenv. We however leave LD because we prefer that build-systems use the c-compiler for linking, it generally works better (copiously tested), however when the build-system explicitly calls ld, we respect that. This gets around the ocaml bug in question, since somehow clang was crashing during link, but the ld tool itself (which is kind of clang, kind of llvm-gcc) is okay with this.

Also moved the setting of O (so that cc-args are refurbished) into a make wrapper. Not sure if this matter much, but seems more consistent.
2012-08-30 20:02:29 -04:00
Max Howell d706eace56 Work for users who delete /usr/bin/ruby
Some people do insane things and are then surprised things break.

Fixes #14546.
2012-08-30 09:55:33 -04:00
Max Howell 0481473163 Some flags must be specified -Wl,foo
Finishes fixing qrupdate. And maybe others.
2012-08-29 22:43:52 -04:00
Max Howell a96686ab33 Warn about removed warnings less shockingly
The problem here now is though that the warnings only appear when compiling verbosely. But they should thus be visible if the build fails. Or if people are hunting for problems.
2012-08-29 15:19:42 -04:00
Max Howell 6fca47ae5f Warn user if they set CFLAGS, etc. with superenv
Since we remove some CFLAGS under their noses, this would otherwise be quite confusing.

Notably, this will now trigger in numerous formula. Sucks.
2012-08-29 12:41:37 -04:00