aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-01-11 11:28:37 -0800
committerAdam Vandenberg2010-01-11 11:36:35 -0800
commit79766ede79650f10b576aa3a76d6eda66210ca90 (patch)
tree65a6775790a802dfa062fc0707e1bb18b6ffd924 /Library
parentd9dc06a0a7e276d504836091b8edd50cb9df10d0 (diff)
downloadhomebrew-79766ede79650f10b576aa3a76d6eda66210ca90.tar.bz2
Detect X11 when ENV.x11 is requested; dump in --config.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb4
-rw-r--r--Library/Homebrew/extend/ENV.rb2
2 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index 2ae9ed669..cad038360 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -504,3 +504,7 @@ def llvm_build
$1.to_i
end
end
+
+def x11_installed?
+ Pathname.new('/usr/X11/lib/libpng.dylib').exist?
+end
diff --git a/Library/Homebrew/extend/ENV.rb b/Library/Homebrew/extend/ENV.rb
index 9fbd04749..09d8a7beb 100644
--- a/Library/Homebrew/extend/ENV.rb
+++ b/Library/Homebrew/extend/ENV.rb
@@ -164,6 +164,8 @@ module HomebrewEnvExtension
append_to_cflags ' -I/usr/include/libxml2'
end
def x11
+ opoo "You do not have X11 installed, this formula may not build." if not x11_installed?
+
# CPPFLAGS are the C-PreProcessor flags, *not* C++!
append 'CPPFLAGS', '-I/usr/X11R6/include'
append 'LDFLAGS', '-L/usr/X11R6/lib'