diff options
| author | Adam Vandenberg | 2010-07-13 14:20:52 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-07-13 14:20:52 -0700 |
| commit | a22bf178572db574e7b358adbd7f58f86f439d33 (patch) | |
| tree | 04d5cf873756fc70c36080d05fa1b5bece88a0c7 /Library/Homebrew/utils.rb | |
| parent | 49d167def59c4c076790c0271e4132737ad95c8c (diff) | |
| download | homebrew-a22bf178572db574e7b358adbd7f58f86f439d33.tar.bz2 | |
Add command "brew --env"
"brew --env" will set up a build environment and then dump certain ENV
variables (CC, CXX, LD, CFLAGS, CXXFLAGS, MAKEFLAGS).
If any of CC, CXX, LD are symlinks, now also output the target compiler.
(Typically these will be symlinks from eg /usr/bin/cc to /usr/bin/gcc-4.2).
This is a diagnostic command which may be merged into --config, turned
into an external command, or removed if it doesn't turn out to be useful.
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index d6170c323..1fc8a9544 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -254,7 +254,19 @@ end def dump_build_env env puts "\"--use-llvm\" was specified" if ARGV.include? '--use-llvm' - %w[ CC CXX LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS MACOSX_DEPLOYMENT_TARGET MAKEFLAGS PKG_CONFIG_PATH + %w[ CC CXX LD ].each do |k| + value = env[k] + if value + results = value + if File.exists? value and File.symlink? value + target = Pathname.new(value) + results += " => #{target.dirname+target.readlink}" + end + puts "#{k}: #{results}" + end + end + + %w[ CFLAGS CXXFLAGS CPPFLAGS LDFLAGS MACOSX_DEPLOYMENT_TARGET MAKEFLAGS PKG_CONFIG_PATH HOMEBREW_DEBUG HOMEBREW_VERBOSE HOMEBREW_USE_LLVM HOMEBREW_SVN ].each do |k| value = env[k] puts "#{k}: #{value}" if value |
