28 Commits

Author SHA1 Message Date
Jack Nagel
8aa42e5bf1 HOMEBREW_USE variables are no longer honored, ignore them 2013-11-07 14:38:49 -06:00
Jack Nagel
17b59fcee0 Display only HOMEBREW_CC/CXX in brew --env under superenv
The other values will be identical.
2013-11-07 14:38:43 -06:00
Jack Nagel
809a52a6a3 audit: activate ENV extensions 2013-08-19 13:03:41 -05:00
Jack Nagel
eebc04ec9b Move common stuff to extend/ENV.rb 2013-08-19 12:32:57 -05:00
Jack Nagel
bf0e329010 Make Superenv activation explicit 2013-08-19 12:32:56 -05:00
Paul Fitzpatrick
61076c1a11 brew --env: Add missing CPATH environment variable
Closes Homebrew/homebrew#20813.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2013-06-27 21:00:22 -07:00
Adam Vandenberg
afd2dde474 --env: show HOMEBREW_CC in superenv
Closes Homebrew/homebrew#18247.
2013-05-02 11:36:30 -07:00
Jack Nagel
2cc9322fbd Exclude global pkgconfig dirs under superenv 2013-03-09 14:46:01 -06:00
Max Howell
6e4a01c70a brew --env: Use fetch rather than []
Because we mess with the return value from [] in superenv due to many formula assuming CFLAGS etc. would not be nil.
2012-09-21 23:30:34 -04:00
Max Howell
30b53cf92a Cram GL headers and includes into superenv
Fixes Homebrew/homebrew#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
d39b7b6b99 brew --env puts HOMEBREW_SDKROOT 2012-08-31 10:22:10 -04:00
Max Howell
672388d4f7 Always find git and svn without trying hard
Two wrapper scripts that find git and svn using the ENV variables we support and then searching through the PATH and looking inside Xcode.app if necessary.

Now just calling git or svn in Homebrew code will find and exec the right tool and we can stop fussing.

Apologies to @adamv who is probably unimpressed that the cmds directory has non-commands in it now. If it's consolation these are temporary pending some more work on superenv whereby some more directories are created under the superenv root.
2012-08-29 12:41:36 -04:00
Max Howell
fb8c7e0aaf Allow eg. brew --env libxml2
Example useful usage:

    eval $(brew --env gettext) && clang -Wl,-t -lssl 2>/dev/null
2012-08-29 12:41:35 -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
samueljohn
27fae8a829 brew --env: Added missing env vars
Closes Homebrew/homebrew#13431.

Signed-off-by: Max Howell <mxcl@me.com>
2012-08-06 18:22:45 -04:00
Jack Nagel
1d2a72eecc Dump Cmake environment variables in brew --env
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-07-01 13:51:23 -05:00
Max Howell
7cedf67680 Scupper sourceable output if brew install is piped
`brew install > file` should not give "export CC=/foo" output on Build Failures.

Also moved the "Using clang" output to brew when BuildError is thrown as that is where it is interesting, and not if you just do `brew --env`.
2012-03-02 00:59:39 +00:00
Max Howell
a77c11ceea Piped brew --env outputs in a sourceable format
So you can source `brew --env` to make it easier to build your own software, etc.
2012-03-01 14:07:40 +00:00
Max Howell
61a8bd9ca0 Don't hang if xcode-select -print-path is "/"
Introducing MacOS.xctools_fucked?.

Refs Homebrew/homebrew#10293.
2012-02-21 10:33:03 +00:00
Jack Nagel
6af4cc9f27 brew --env: fix path to xcrun
Fixes Homebrew/homebrew#10327.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-02-19 20:32:06 -06:00
Max Howell
607c13c32b Find xcrun if user doesn't ever install Xcode 4.3 helper tools 2012-02-17 13:34:06 +00:00
Max Howell
4504662033 Use xcrun; Ensure clang is the default compiler with Xcode 4.3
Using xcrun as a proxy to execute the compiler tools is per its design. This means you can't treat ENV['CC'] as a path anymore, but I think I found the cases this was being expected and corrected them. It was not proper anyway to assume the variable was a path, it can be anything. Like a proxy. Like xcrun.

Also more thoroughly clear ENV.
2012-02-16 23:43:43 +00:00
Jack Nagel
d7c1d355f1 brew --env: respect --universal
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-12-31 21:22:22 -06:00
Jack Nagel
7df7bd6a48 --env: dump a few more environment variables
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2011-12-16 19:47:37 -06:00
Adam Vandenberg
be63ae9b14 Inclue HOMEBREW_USE_CLANG in --env output 2011-06-16 20:58:06 -07:00
José Martínez
2763fc6f5a Add clang compiler option
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-06-16 20:45:52 -07:00
Stephen Allred
618617da73 Added --use-gcc flag.
This allows you to use llvm as your default compiler and keep the cc symlink
pointed at llvm, while allowing you to build forumla that requires the gcc.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-03-12 11:55:06 -08:00
Max Howell
768910283a Refactor the brew command into one file per command
The code was sucking. To the extent that maintenance was hard. It's a lot
easier to work with code that is sensibly split at sensible boundaries. So
now it is more like that.

But the refactor is minimal. Because we don't want you to have more merge
hell than absolutely necessary.

If you merge you will need to pay attention to brew.h.rb (as it is deleted)
and bin/brew (as command logic is gone). It will be painful, but you will just
have to help git out by moving any changes around manually.

Note compatibility.rb. It ensures that any function renames or removals don't
break anything. We're pretty serious about backwards compatibility. And that's
because we encourage you to hack around with the innards. And we couldn't do
that if we would then just make stuff disappear behind your back.
2011-03-12 11:55:02 -08:00