27 Commits

Author SHA1 Message Date
Jack Nagel
3ccca7720f Rewrite xcrun wrapper in shell 2014-06-03 10:03:34 -05:00
Jack Nagel
089af6627a Always use stub tools in /usr/bin on 10.9 2014-05-08 17:24:48 -05:00
Jack Nagel
cf23fd2e14 xcrun wrapper: rephrase comments 2014-04-29 21:51:18 -05:00
Jack Nagel
4cff03b730 xcrun wrapper: reorganize so we only access ARGV once 2014-04-29 21:51:17 -05:00
Jack Nagel
2a81f8c305 xcrun wrapper: inline try method 2014-04-29 21:51:17 -05:00
Jack Nagel
c6c9aa546f xcrun wrapper: skip superenv bin when walking PATH 2014-04-29 21:51:17 -05:00
Jack Nagel
9d72555644 Print the attempted command when xcrun wrapper fails 2014-04-21 11:05:30 -05:00
Jack Nagel
4b4b6e183e Use File::PATH_SEPARATOR since we use it everywhere else 2014-04-21 11:03:44 -05:00
Jack Nagel
201a1ad9eb Delay loading Pathname until we absolutely need it 2014-04-20 17:00:44 -05:00
Jack Nagel
a00dcd0079 Use a multiline conditional to make this code more readable 2014-04-20 16:52:59 -05:00
Jack Nagel
275e66e08d Stop loading a bunch of monkeypatches every time xcrun is invoked 2014-04-20 16:48:55 -05:00
Jack Nagel
91cc7aca49 Use File.expand_path 2014-04-20 16:33:41 -05:00
Jack Nagel
dd8dc7a380 Remove obsolete DEVELOPER_DIR hacks
These days Homebrew refuses to do anything if the xcode-select path is
busted, so this workaround is unnecessary.
2014-04-20 16:33:41 -05:00
Jack Nagel
a40a0e1862 Remove some monkeypatches 2013-11-21 17:17:55 -06:00
Misty De Meo
cd3dc66696 Silence xcrun output in wrapper
Our wrapper always runs the real xcrun at least once, to try to find
the path of the tool being run, but this meant that we were generating
a huge number of error messages on every cc invocaton. Mostly this was
annoying but harmless, but notably it managed to break the compilation
of go.
2013-09-25 09:15:26 -07:00
Samuel John
0688991507 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
63b9031159 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
Samuel John
c6b0b563e8 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 Homebrew/homebrew#18618
2013-03-21 17:10:32 +01:00
Adam Vandenberg
1283bd8381 xcrun: remove suggestion that doesn't work
Closes Homebrew/homebrew#17443.
2013-02-05 11:22:47 -08:00
Misty De Meo
88609dd6ed 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
Max Howell
64927a45ef Restore HOMEBREW_LOG functionality 2012-09-29 09:57:37 -04:00
Max Howell
d0f707f893 Determine SUPERBIN correctly 2012-09-25 11:31:56 -04:00
Max Howell
1ae0e93d7e Abort if xcrun -find foo returns superbin/foo
Fixes Homebrew/homebrew#14691.

Rewrite in Ruby to facilitate checking PATHs properly.
2012-09-24 09:49:53 -04:00
Max Howell
da1905f216 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
2375f71e82 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
2856a97ce3 Refs Homebrew/homebrew#14558. Try to find tools when xcrun fails. 2012-08-31 10:22:11 -04:00
Max Howell
65d195dcaa superenv: build-environments that just work
1. A minimal build environment, we don't set CFLAGS, CPPFLAGS, LDFLAGS, etc. the rationale being, the less that is set, the less variables we are introducing that can break builds.
2. A set of scripts that replace cc, ld, etc. and inject the -I, -L, etc. flags we need into the args passed to the build-tools.

Because we now have complete control over compiler instantiations we do a variety of clean-up tasks, like removing bad flags, enforcing universal builds and ensuring makefiles don't try to change the order of library and include paths from ones that work to ones that don't.

The previous ENV-system is still available when --env=std is specified.

superenv applies to Xcode >= 4.3 only currently.
2012-08-29 12:41:34 -04:00