Detect X11 when ENV.x11 is requested; dump in --config.

This commit is contained in:
Adam Vandenberg 2010-01-11 11:28:37 -08:00
parent 56351558b8
commit 24b6e9c721
3 changed files with 7 additions and 0 deletions

View File

@ -504,3 +504,7 @@ def llvm_build
$1.to_i $1.to_i
end end
end end
def x11_installed?
Pathname.new('/usr/X11/lib/libpng.dylib').exist?
end

View File

@ -164,6 +164,8 @@ module HomebrewEnvExtension
append_to_cflags ' -I/usr/include/libxml2' append_to_cflags ' -I/usr/include/libxml2'
end end
def x11 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++! # CPPFLAGS are the C-PreProcessor flags, *not* C++!
append 'CPPFLAGS', '-I/usr/X11R6/include' append 'CPPFLAGS', '-I/usr/X11R6/include'
append 'LDFLAGS', '-L/usr/X11R6/lib' append 'LDFLAGS', '-L/usr/X11R6/lib'

View File

@ -65,6 +65,7 @@ Ruby: #{RUBY_VERSION}-#{RUBY_PATCHLEVEL}
GCC-4.2: #{gcc ? "build #{gcc}" : "N/A"} GCC-4.2: #{gcc ? "build #{gcc}" : "N/A"}
LLVM: #{llvm ? "build #{llvm}" : "N/A" } LLVM: #{llvm ? "build #{llvm}" : "N/A" }
MacPorts or Fink? #{macports_or_fink_installed?} MacPorts or Fink? #{macports_or_fink_installed?}
X11 installed? #{x11_installed?}
EOS EOS
end end