2013-06-01 16:27:53 -05:00
|
|
|
require 'hardware'
|
2013-08-19 12:32:59 -05:00
|
|
|
require 'extend/ENV/shared'
|
2013-08-19 12:32:59 -05:00
|
|
|
require 'extend/ENV/super'
|
2013-08-19 12:32:57 -05:00
|
|
|
|
|
|
|
def superenv?
|
|
|
|
return false if MacOS::Xcode.without_clt? && MacOS.sdk_path.nil?
|
|
|
|
return false unless Superenv.bin && Superenv.bin.directory?
|
|
|
|
return false if ARGV.include? "--env=std"
|
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
module EnvActivation
|
|
|
|
def activate_extensions!
|
|
|
|
if superenv?
|
|
|
|
extend(Superenv)
|
|
|
|
else
|
|
|
|
extend(HomebrewEnvExtension)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
ENV.extend(EnvActivation)
|
2013-06-01 16:27:53 -05:00
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
module HomebrewEnvExtension
|
2013-08-19 12:32:59 -05:00
|
|
|
include SharedEnvExtension
|
|
|
|
|
2009-12-02 12:17:14 +00:00
|
|
|
SAFE_CFLAGS_FLAGS = "-w -pipe"
|
2013-06-13 18:28:41 -05:00
|
|
|
DEFAULT_FLAGS = '-march=core2 -msse4'
|
2009-10-15 12:36:09 +01:00
|
|
|
|
2013-08-19 12:32:57 -05:00
|
|
|
def self.extended(base)
|
|
|
|
unless ORIGINAL_PATHS.include? HOMEBREW_PREFIX/'bin'
|
|
|
|
base.prepend_path 'PATH', "#{HOMEBREW_PREFIX}/bin"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
def setup_build_environment
|
|
|
|
# Clear CDPATH to avoid make issues that depend on changing directories
|
2010-08-10 07:58:08 -07:00
|
|
|
delete('CDPATH')
|
2012-02-16 17:12:53 +00:00
|
|
|
delete('GREP_OPTIONS') # can break CMake (lol)
|
2012-02-16 16:55:28 -06:00
|
|
|
delete('CLICOLOR_FORCE') # autotools doesn't like this
|
2013-03-16 13:50:44 -05:00
|
|
|
%w{CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH}.each { |k| delete(k) }
|
2012-02-16 23:39:57 +00:00
|
|
|
remove_cc_etc
|
2009-10-15 12:36:09 +01:00
|
|
|
|
2012-08-14 11:37:29 -05:00
|
|
|
if MacOS.version >= :mountain_lion
|
2012-09-03 21:26:03 -05:00
|
|
|
# Mountain Lion's sed is stricter, and errors out when
|
|
|
|
# it encounters files with mixed character sets
|
2012-08-02 16:52:33 +01:00
|
|
|
delete('LC_ALL')
|
2012-08-04 10:48:23 +01:00
|
|
|
self['LC_CTYPE']="C"
|
2012-07-28 20:02:33 -03:00
|
|
|
end
|
|
|
|
|
2012-09-03 21:28:20 -05:00
|
|
|
# Set the default pkg-config search path, overriding the built-in paths
|
|
|
|
# Anything in PKG_CONFIG_PATH is searched before paths in this variable
|
|
|
|
self['PKG_CONFIG_LIBDIR'] = determine_pkg_config_libdir
|
|
|
|
|
2012-02-27 04:06:13 +00:00
|
|
|
# make any aclocal stuff installed in Homebrew available
|
2012-07-10 20:25:16 -05:00
|
|
|
self['ACLOCAL_PATH'] = "#{HOMEBREW_PREFIX}/share/aclocal" if MacOS::Xcode.provides_autotools?
|
2012-02-27 04:06:13 +00:00
|
|
|
|
2011-07-26 00:01:22 -05:00
|
|
|
self['MAKEFLAGS'] = "-j#{self.make_jobs}"
|
2009-10-15 12:36:09 +01:00
|
|
|
|
|
|
|
unless HOMEBREW_PREFIX.to_s == '/usr/local'
|
2009-12-01 11:27:44 +00:00
|
|
|
# /usr/local is already an -isystem and -L directory so we skip it
|
2010-08-10 07:58:08 -07:00
|
|
|
self['CPPFLAGS'] = "-isystem #{HOMEBREW_PREFIX}/include"
|
|
|
|
self['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib"
|
2009-12-09 04:49:19 +01:00
|
|
|
# CMake ignores the variables above
|
2010-08-10 07:58:08 -07:00
|
|
|
self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
|
|
|
|
2013-01-04 21:30:10 -08:00
|
|
|
if (HOMEBREW_PREFIX/'Frameworks').exist?
|
|
|
|
append 'CPPFLAGS', "-F#{HOMEBREW_PREFIX}/Frameworks"
|
|
|
|
append 'LDFLAGS', "-F#{HOMEBREW_PREFIX}/Frameworks"
|
|
|
|
self['CMAKE_FRAMEWORK_PATH'] = HOMEBREW_PREFIX/"Frameworks"
|
|
|
|
end
|
2012-11-05 18:13:54 -06:00
|
|
|
|
2012-02-16 17:23:11 +00:00
|
|
|
# Os is the default Apple uses for all its stuff so let's trust them
|
2012-02-20 13:16:58 -08:00
|
|
|
set_cflags "-Os #{SAFE_CFLAGS_FLAGS}"
|
2010-02-12 13:35:29 +00:00
|
|
|
|
2012-02-16 18:00:04 +00:00
|
|
|
# set us up for the user's compiler choice
|
2011-11-23 19:52:00 +00:00
|
|
|
self.send self.compiler
|
2012-02-16 18:00:04 +00:00
|
|
|
|
2011-08-31 17:50:39 +01:00
|
|
|
# we must have a working compiler!
|
2012-03-21 11:58:32 -05:00
|
|
|
unless self['CC']
|
2011-11-23 19:52:00 +00:00
|
|
|
@compiler = MacOS.default_compiler
|
|
|
|
self.send @compiler
|
2012-11-13 17:22:36 -08:00
|
|
|
self['CC'] = self['OBJC'] = MacOS.locate("cc")
|
|
|
|
self['CXX'] = self['OBJCXX'] = MacOS.locate("c++")
|
2011-09-06 11:20:09 +01:00
|
|
|
end
|
2011-08-31 17:50:39 +01:00
|
|
|
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# Add lib and include etc. from the current macosxsdk to compiler flags:
|
|
|
|
macosxsdk MacOS.version
|
|
|
|
|
|
|
|
# For Xcode 4.3 (*without* the "Command Line Tools for Xcode") compiler and tools inside of Xcode:
|
2012-07-09 14:58:34 -05:00
|
|
|
if not MacOS::CLT.installed? and MacOS::Xcode.installed? and MacOS::Xcode.version >= "4.3"
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# Some tools (clang, etc.) are in the xctoolchain dir of Xcode
|
|
|
|
append 'PATH', "#{MacOS.xctoolchain_path}/usr/bin", ":" if MacOS.xctoolchain_path
|
|
|
|
# Others are now at /Applications/Xcode.app/Contents/Developer/usr/bin
|
|
|
|
append 'PATH', "#{MacOS.dev_tools_path}", ":"
|
|
|
|
end
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2010-08-09 21:03:29 -07:00
|
|
|
|
2012-09-03 21:28:20 -05:00
|
|
|
def determine_pkg_config_libdir
|
|
|
|
paths = []
|
|
|
|
paths << HOMEBREW_PREFIX/'lib/pkgconfig'
|
|
|
|
paths << HOMEBREW_PREFIX/'share/pkgconfig'
|
2013-03-08 18:10:35 -06:00
|
|
|
paths << HOMEBREW_REPOSITORY/"Library/ENV/pkgconfig/#{MacOS.version}"
|
2012-09-03 21:28:20 -05:00
|
|
|
paths << '/usr/lib/pkgconfig'
|
|
|
|
paths.select { |d| File.directory? d }.join(':')
|
|
|
|
end
|
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
def deparallelize
|
|
|
|
remove 'MAKEFLAGS', /-j\d+/
|
|
|
|
end
|
|
|
|
alias_method :j1, :deparallelize
|
2009-10-23 14:51:40 +01:00
|
|
|
|
2010-02-12 13:35:29 +00:00
|
|
|
# recommended by Apple, but, eg. wget won't compile with this flag, so…
|
|
|
|
def fast
|
2010-10-25 21:12:41 -07:00
|
|
|
remove_from_cflags(/-O./)
|
2010-02-12 13:35:29 +00:00
|
|
|
append_to_cflags '-fast'
|
|
|
|
end
|
2010-06-18 14:32:25 -07:00
|
|
|
def O4
|
|
|
|
# LLVM link-time optimization
|
2010-10-25 21:12:41 -07:00
|
|
|
remove_from_cflags(/-O./)
|
2010-06-18 14:32:25 -07:00
|
|
|
append_to_cflags '-O4'
|
|
|
|
end
|
2009-10-23 14:51:40 +01:00
|
|
|
def O3
|
|
|
|
# Sometimes O4 just takes fucking forever
|
2010-10-25 21:12:41 -07:00
|
|
|
remove_from_cflags(/-O./)
|
2009-10-23 14:51:40 +01:00
|
|
|
append_to_cflags '-O3'
|
|
|
|
end
|
|
|
|
def O2
|
|
|
|
# Sometimes O3 doesn't work or produces bad binaries
|
2010-10-25 21:12:41 -07:00
|
|
|
remove_from_cflags(/-O./)
|
2009-10-23 14:51:40 +01:00
|
|
|
append_to_cflags '-O2'
|
|
|
|
end
|
2009-12-02 12:17:14 +00:00
|
|
|
def Os
|
|
|
|
# Sometimes you just want a small one
|
2010-10-25 21:12:41 -07:00
|
|
|
remove_from_cflags(/-O./)
|
2009-12-02 12:17:14 +00:00
|
|
|
append_to_cflags '-Os'
|
|
|
|
end
|
2011-05-24 18:15:05 -07:00
|
|
|
def Og
|
|
|
|
# Sometimes you want a debug build
|
|
|
|
remove_from_cflags(/-O./)
|
|
|
|
append_to_cflags '-g -O0'
|
|
|
|
end
|
2012-02-06 21:54:02 -06:00
|
|
|
def O1
|
|
|
|
# Sometimes even O2 doesn't work :(
|
|
|
|
remove_from_cflags(/-O./)
|
|
|
|
append_to_cflags '-O1'
|
|
|
|
end
|
2009-10-23 14:51:40 +01:00
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
def gcc_4_0_1
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# we don't use locate because gcc 4.0 has not been provided since Xcode 4
|
2012-11-13 17:22:36 -08:00
|
|
|
self['CC'] = self['OBJC'] = "#{MacOS.dev_tools_path}/gcc-4.0"
|
|
|
|
self['CXX'] = self['OBJCXX'] = "#{MacOS.dev_tools_path}/g++-4.0"
|
2011-11-23 19:52:00 +00:00
|
|
|
replace_in_cflags '-O4', '-O3'
|
2013-06-13 13:32:06 -05:00
|
|
|
set_cpu_cflags '-march=nocona -mssse3'
|
2011-09-06 11:20:09 +01:00
|
|
|
@compiler = :gcc
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2009-12-02 10:39:06 +00:00
|
|
|
alias_method :gcc_4_0, :gcc_4_0_1
|
|
|
|
|
2012-02-16 23:39:57 +00:00
|
|
|
# if your formula doesn't like CC having spaces use this
|
|
|
|
def expand_xcrun
|
2012-03-21 11:58:32 -05:00
|
|
|
self['CC'] =~ %r{/usr/bin/xcrun (.*)}
|
|
|
|
self['CC'] = `/usr/bin/xcrun -find #{$1}`.chomp if $1
|
|
|
|
self['CXX'] =~ %r{/usr/bin/xcrun (.*)}
|
|
|
|
self['CXX'] = `/usr/bin/xcrun -find #{$1}`.chomp if $1
|
|
|
|
self['OBJC'] = self['CC']
|
2012-11-13 17:22:36 -08:00
|
|
|
self['OBJCXX'] = self['CXX']
|
2012-02-16 23:39:57 +00:00
|
|
|
end
|
|
|
|
|
2012-02-21 00:17:19 -06:00
|
|
|
def gcc
|
2012-02-16 18:00:04 +00:00
|
|
|
# Apple stopped shipping gcc-4.2 with Xcode 4.2
|
|
|
|
# However they still provide a gcc symlink to llvm
|
|
|
|
# But we don't want LLVM of course.
|
|
|
|
|
2012-11-13 17:22:36 -08:00
|
|
|
self['CC'] = self['OBJC'] = MacOS.locate("gcc-4.2")
|
|
|
|
self['CXX'] = self['OBJCXX'] = MacOS.locate("g++-4.2")
|
2012-02-16 23:39:57 +00:00
|
|
|
|
2012-03-21 11:58:32 -05:00
|
|
|
unless self['CC']
|
2012-11-13 17:22:36 -08:00
|
|
|
self['CC'] = self['OBJC'] = "#{HOMEBREW_PREFIX}/bin/gcc-4.2"
|
|
|
|
self['CXX'] = self['OBJCXX'] = "#{HOMEBREW_PREFIX}/bin/g++-4.2"
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
raise "GCC could not be found" unless File.exist? self['CC']
|
2012-02-16 23:39:57 +00:00
|
|
|
end
|
|
|
|
|
2012-03-21 11:58:32 -05:00
|
|
|
if not self['CC'] =~ %r{^/usr/bin/xcrun }
|
|
|
|
raise "GCC could not be found" if Pathname.new(self['CC']).realpath.to_s =~ /llvm/
|
2012-02-16 23:39:57 +00:00
|
|
|
end
|
|
|
|
|
2011-11-23 19:52:00 +00:00
|
|
|
replace_in_cflags '-O4', '-O3'
|
2013-06-13 13:32:06 -05:00
|
|
|
set_cpu_cflags
|
2011-09-06 11:20:09 +01:00
|
|
|
@compiler = :gcc
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2011-08-26 13:53:36 +01:00
|
|
|
alias_method :gcc_4_2, :gcc
|
2009-10-23 14:51:40 +01:00
|
|
|
|
2010-06-17 10:57:41 -05:00
|
|
|
def llvm
|
2012-11-13 17:22:36 -08:00
|
|
|
self['CC'] = self['OBJC'] = MacOS.locate("llvm-gcc")
|
|
|
|
self['CXX'] = self['OBJCXX'] = MacOS.locate("llvm-g++")
|
2013-06-13 13:32:06 -05:00
|
|
|
set_cpu_cflags
|
2011-09-06 11:20:09 +01:00
|
|
|
@compiler = :llvm
|
2011-08-26 13:53:36 +01:00
|
|
|
end
|
|
|
|
|
2012-02-21 00:17:19 -06:00
|
|
|
def clang
|
2012-11-13 17:22:36 -08:00
|
|
|
self['CC'] = self['OBJC'] = MacOS.locate("clang")
|
|
|
|
self['CXX'] = self['OBJCXX'] = MacOS.locate("clang++")
|
2013-08-01 20:19:00 -07:00
|
|
|
replace_in_cflags(/-Xarch_#{Hardware::CPU.arch_32_bit} (-march=\S*)/, '\1')
|
2011-11-23 19:52:00 +00:00
|
|
|
# Clang mistakenly enables AES-NI on plain Nehalem
|
2013-03-17 13:30:12 -05:00
|
|
|
set_cpu_cflags '-march=native', :nehalem => '-march=native -Xclang -target-feature -Xclang -aes'
|
2012-02-18 12:25:23 -06:00
|
|
|
append_to_cflags '-Qunused-arguments'
|
2011-09-06 11:20:09 +01:00
|
|
|
@compiler = :clang
|
2010-06-17 10:57:41 -05:00
|
|
|
end
|
|
|
|
|
2013-06-13 18:45:44 -05:00
|
|
|
def remove_macosxsdk version=MacOS.version
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# Clear all lib and include dirs from CFLAGS, CPPFLAGS, LDFLAGS that were
|
|
|
|
# previously added by macosxsdk
|
2013-06-13 18:45:44 -05:00
|
|
|
version = version.to_s
|
2009-10-15 12:36:09 +01:00
|
|
|
remove_from_cflags(/ ?-mmacosx-version-min=10\.\d/)
|
2013-06-13 18:44:20 -05:00
|
|
|
delete('MACOSX_DEPLOYMENT_TARGET')
|
|
|
|
delete('CPATH')
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
remove 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
|
2013-06-14 10:13:55 -05:00
|
|
|
|
|
|
|
if (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed?
|
2013-06-13 18:44:20 -05:00
|
|
|
delete('SDKROOT')
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
remove_from_cflags "-isysroot #{sdk}"
|
2012-08-21 16:38:23 +02:00
|
|
|
remove 'CPPFLAGS', "-isysroot #{sdk}"
|
|
|
|
remove 'LDFLAGS', "-isysroot #{sdk}"
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
if HOMEBREW_PREFIX.to_s == '/usr/local'
|
2013-06-13 18:44:20 -05:00
|
|
|
delete('CMAKE_PREFIX_PATH')
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
else
|
|
|
|
# It was set in setup_build_environment, so we have to restore it here.
|
|
|
|
self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
|
|
|
|
end
|
|
|
|
remove 'CMAKE_FRAMEWORK_PATH', "#{sdk}/System/Library/Frameworks"
|
|
|
|
end
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
|
2013-06-13 18:45:44 -05:00
|
|
|
def macosxsdk version=MacOS.version
|
2013-03-10 17:03:40 +00:00
|
|
|
return unless MACOS
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# Sets all needed lib and include dirs to CFLAGS, CPPFLAGS, LDFLAGS.
|
|
|
|
remove_macosxsdk
|
2013-06-13 18:45:44 -05:00
|
|
|
version = version.to_s
|
|
|
|
append_to_cflags("-mmacosx-version-min=#{version}")
|
|
|
|
self['MACOSX_DEPLOYMENT_TARGET'] = version
|
2012-08-21 16:38:23 +02:00
|
|
|
self['CPATH'] = "#{HOMEBREW_PREFIX}/include"
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
prepend 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
|
2013-06-14 10:13:55 -05:00
|
|
|
|
|
|
|
if (sdk = MacOS.sdk_path(version)) && !MacOS::CLT.installed?
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# Extra setup to support Xcode 4.3+ without CLT.
|
|
|
|
self['SDKROOT'] = sdk
|
2012-08-21 16:38:23 +02:00
|
|
|
# Tell clang/gcc where system include's are:
|
|
|
|
append 'CPATH', "#{sdk}/usr/include", ":"
|
|
|
|
# The -isysroot is needed, too, because of the Frameworks
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
append_to_cflags "-isysroot #{sdk}"
|
2012-08-21 16:38:23 +02:00
|
|
|
append 'CPPFLAGS', "-isysroot #{sdk}"
|
|
|
|
# And the linker needs to find sdk/usr/lib
|
|
|
|
append 'LDFLAGS', "-isysroot #{sdk}"
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
# Needed to build cmake itself and perhaps some cmake projects:
|
|
|
|
append 'CMAKE_PREFIX_PATH', "#{sdk}/usr", ':'
|
|
|
|
append 'CMAKE_FRAMEWORK_PATH', "#{sdk}/System/Library/Frameworks", ':'
|
|
|
|
end
|
2009-10-23 14:51:40 +01:00
|
|
|
end
|
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
def minimal_optimization
|
2010-08-10 07:58:08 -07:00
|
|
|
self['CFLAGS'] = self['CXXFLAGS'] = "-Os #{SAFE_CFLAGS_FLAGS}"
|
2012-07-09 14:58:34 -05:00
|
|
|
macosxsdk unless MacOS::CLT.installed?
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
|
|
|
def no_optimization
|
2010-08-10 07:58:08 -07:00
|
|
|
self['CFLAGS'] = self['CXXFLAGS'] = SAFE_CFLAGS_FLAGS
|
2012-07-09 14:58:34 -05:00
|
|
|
macosxsdk unless MacOS::CLT.installed?
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2009-12-02 12:17:14 +00:00
|
|
|
|
2011-03-14 13:58:30 -07:00
|
|
|
# Some configure scripts won't find libxml2 without help
|
2009-10-15 12:36:09 +01:00
|
|
|
def libxml2
|
2012-07-09 14:58:34 -05:00
|
|
|
if MacOS::CLT.installed?
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
append 'CPPFLAGS', '-I/usr/include/libxml2'
|
|
|
|
else
|
|
|
|
# Use the includes form the sdk
|
|
|
|
append 'CPPFLAGS', "-I#{MacOS.sdk_path}/usr/include/libxml2"
|
|
|
|
end
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2010-08-07 16:50:45 -07:00
|
|
|
|
2012-09-03 20:59:49 -05:00
|
|
|
def x11
|
2012-07-25 15:04:46 -05:00
|
|
|
# There are some config scripts here that should go in the PATH
|
2012-09-03 21:28:20 -05:00
|
|
|
append 'PATH', MacOS::X11.bin, ':'
|
2012-06-05 22:21:15 +02:00
|
|
|
|
2012-09-03 21:28:20 -05:00
|
|
|
# Append these to PKG_CONFIG_LIBDIR so they are searched
|
|
|
|
# *after* our own pkgconfig directories, as we dupe some of the
|
|
|
|
# libs in XQuartz.
|
|
|
|
append 'PKG_CONFIG_LIBDIR', MacOS::X11.lib/'pkgconfig', ':'
|
|
|
|
append 'PKG_CONFIG_LIBDIR', MacOS::X11.share/'pkgconfig', ':'
|
2012-06-05 22:21:15 +02:00
|
|
|
|
2012-08-06 00:33:36 -05:00
|
|
|
append 'LDFLAGS', "-L#{MacOS::X11.lib}"
|
|
|
|
append 'CMAKE_PREFIX_PATH', MacOS::X11.prefix, ':'
|
|
|
|
append 'CMAKE_INCLUDE_PATH', MacOS::X11.include, ':'
|
2012-06-05 22:21:15 +02:00
|
|
|
|
2012-08-06 00:33:36 -05:00
|
|
|
append 'CPPFLAGS', "-I#{MacOS::X11.include}"
|
2012-06-05 22:21:15 +02:00
|
|
|
|
2012-09-05 19:49:50 -05:00
|
|
|
append 'ACLOCAL_PATH', MacOS::X11.share/'aclocal', ':'
|
|
|
|
|
2012-07-09 14:58:34 -05:00
|
|
|
unless MacOS::CLT.installed?
|
2012-07-25 15:04:46 -05:00
|
|
|
append 'CMAKE_PREFIX_PATH', MacOS.sdk_path/'usr/X11', ':'
|
2012-08-06 00:33:36 -05:00
|
|
|
append 'CPPFLAGS', "-I#{MacOS::X11.include}/freetype2"
|
|
|
|
append 'CFLAGS', "-I#{MacOS::X11.include}"
|
Core change: XCode only install, with CLT or both
Allow XCode without the Command Line Tools to
work with homebrew, so it's not necessary
to register an Apple Dev ID and/or go to the
XCode prefs and download the CLT. Yay!
Further, this commit allows to use the CLT
solely (without the need for XCode).
Saves quite some megs.
(Some furmulae require xcodebuild)
Of course XCode together with the CLT is still
fine and has been tested on 10.7 and 10.6
with Xcode 4 and Xcode 3.
Only on Lion or above, tell the user about the options,
which are
- Xcode without CLT
- CLT without Xcode
- both (ok, it's not directly stated, but implicit)
So if no Xcode is found and we are on Lion or above,
we don't fail but check for the CLTs now.
For older Macs, the old message that Xcode is needed
and the installer should be run is still displayed.
If the CLT are not found but Xcode is, then we
print out about the experimental status of this setup.
Closes Homebrew/homebrew#10510.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2012-02-26 21:04:15 +01:00
|
|
|
end
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
|
|
|
alias_method :libpng, :x11
|
2010-08-07 16:50:45 -07:00
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
# we've seen some packages fail to build when warnings are disabled!
|
|
|
|
def enable_warnings
|
|
|
|
remove_from_cflags '-w'
|
2012-02-21 00:38:57 -06:00
|
|
|
remove_from_cflags '-Qunused-arguments'
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2010-08-10 08:01:06 -07:00
|
|
|
|
2009-10-15 12:36:09 +01:00
|
|
|
def m64
|
|
|
|
append_to_cflags '-m64'
|
2013-08-01 20:19:00 -07:00
|
|
|
append 'LDFLAGS', "-arch #{Hardware::CPU.arch_64_bit}"
|
2009-10-15 12:36:09 +01:00
|
|
|
end
|
2009-10-23 14:51:50 +01:00
|
|
|
def m32
|
|
|
|
append_to_cflags '-m32'
|
2013-08-01 20:19:00 -07:00
|
|
|
append 'LDFLAGS', "-arch #{Hardware::CPU.arch_32_bit}"
|
2009-10-23 14:51:50 +01:00
|
|
|
end
|
|
|
|
|
2009-10-19 12:44:30 +01:00
|
|
|
def universal_binary
|
2013-08-15 23:04:26 -07:00
|
|
|
append_to_cflags Hardware::CPU.universal_archs.as_arch_flags
|
2011-11-23 19:52:00 +00:00
|
|
|
replace_in_cflags '-O4', '-O3' # O4 seems to cause the build to fail
|
2013-08-15 23:04:26 -07:00
|
|
|
append 'LDFLAGS', Hardware::CPU.universal_archs.as_arch_flags
|
2010-04-22 11:15:03 -07:00
|
|
|
|
2013-06-13 18:41:14 -05:00
|
|
|
if compiler != :clang && Hardware.is_32_bit?
|
2011-11-23 19:52:00 +00:00
|
|
|
# Can't mix "-march" for a 32-bit CPU with "-arch x86_64"
|
2013-08-16 20:47:41 -05:00
|
|
|
replace_in_cflags(/-march=\S*/, "-Xarch_#{Hardware::CPU.arch_32_bit} \\0")
|
2011-11-23 19:52:00 +00:00
|
|
|
end
|
2009-10-19 12:44:30 +01:00
|
|
|
end
|
2009-10-15 12:36:09 +01:00
|
|
|
|
2011-11-23 19:52:00 +00:00
|
|
|
def replace_in_cflags before, after
|
2013-06-13 18:28:41 -05:00
|
|
|
CC_FLAG_VARS.each do |key|
|
2013-06-13 18:40:08 -05:00
|
|
|
self[key] = self[key].sub(before, after) if has_key?(key)
|
2011-11-23 19:52:00 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-02-20 13:16:58 -08:00
|
|
|
# Convenience method to set all C compiler flags in one shot.
|
2013-06-13 18:39:52 -05:00
|
|
|
def set_cflags val
|
|
|
|
CC_FLAG_VARS.each { |key| self[key] = val }
|
2012-02-20 13:16:58 -08:00
|
|
|
end
|
|
|
|
|
2012-03-07 18:33:32 -08:00
|
|
|
# Sets architecture-specific flags for every environment variable
|
|
|
|
# given in the list `flags`.
|
2013-06-13 18:28:41 -05:00
|
|
|
def set_cpu_flags flags, default=DEFAULT_FLAGS, map=Hardware::CPU.optimization_flags
|
2013-08-01 20:19:00 -07:00
|
|
|
cflags =~ %r{(-Xarch_#{Hardware::CPU.arch_32_bit} )-march=}
|
2011-11-23 19:52:00 +00:00
|
|
|
xarch = $1.to_s
|
2013-08-01 20:19:00 -07:00
|
|
|
remove flags, %r{(-Xarch_#{Hardware::CPU.arch_32_bit} )?-march=\S*}
|
2012-03-07 18:33:32 -08:00
|
|
|
remove flags, %r{( -Xclang \S+)+}
|
|
|
|
remove flags, %r{-mssse3}
|
|
|
|
remove flags, %r{-msse4(\.\d)?}
|
|
|
|
append flags, xarch unless xarch.empty?
|
2012-02-21 00:13:07 -06:00
|
|
|
|
2011-12-31 19:10:05 +00:00
|
|
|
if ARGV.build_bottle?
|
2013-06-06 16:02:27 -05:00
|
|
|
append flags, Hardware::CPU.optimization_flags[Hardware.oldest_cpu]
|
2011-12-31 19:10:05 +00:00
|
|
|
else
|
2012-02-21 00:13:07 -06:00
|
|
|
# Don't set -msse3 and older flags because -march does that for us
|
2013-03-17 13:30:12 -05:00
|
|
|
append flags, map.fetch(Hardware::CPU.family, default)
|
2011-12-31 19:10:05 +00:00
|
|
|
end
|
2012-02-18 12:25:23 -06:00
|
|
|
|
|
|
|
# not really a 'CPU' cflag, but is only used with clang
|
2012-03-07 18:33:32 -08:00
|
|
|
remove flags, '-Qunused-arguments'
|
|
|
|
end
|
|
|
|
|
2013-06-13 18:28:41 -05:00
|
|
|
def set_cpu_cflags default=DEFAULT_FLAGS, map=Hardware::CPU.optimization_flags
|
|
|
|
set_cpu_flags CC_FLAG_VARS, default, map
|
2011-11-23 19:52:00 +00:00
|
|
|
end
|
|
|
|
|
2011-09-06 11:20:09 +01:00
|
|
|
# actually c-compiler, so cc would be a better name
|
2011-08-26 14:21:37 +01:00
|
|
|
def compiler
|
|
|
|
# test for --flags first so that installs can be overridden on a per
|
2011-09-01 14:17:29 +01:00
|
|
|
# install basis. Then test for ENVs in inverse order to flags, this is
|
|
|
|
# sensible, trust me
|
2011-09-06 11:20:09 +01:00
|
|
|
@compiler ||= if ARGV.include? '--use-gcc'
|
2011-08-26 14:21:37 +01:00
|
|
|
:gcc
|
|
|
|
elsif ARGV.include? '--use-llvm'
|
|
|
|
:llvm
|
|
|
|
elsif ARGV.include? '--use-clang'
|
|
|
|
:clang
|
2011-09-01 14:17:29 +01:00
|
|
|
elsif self['HOMEBREW_USE_CLANG']
|
2011-08-26 14:21:37 +01:00
|
|
|
:clang
|
|
|
|
elsif self['HOMEBREW_USE_LLVM']
|
|
|
|
:llvm
|
|
|
|
elsif self['HOMEBREW_USE_GCC']
|
|
|
|
:gcc
|
|
|
|
else
|
2011-08-31 16:59:04 +01:00
|
|
|
MacOS.default_compiler
|
2011-08-26 14:21:37 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-07-26 00:01:22 -05:00
|
|
|
def make_jobs
|
|
|
|
# '-j' requires a positive integral argument
|
|
|
|
if self['HOMEBREW_MAKE_JOBS'].to_i > 0
|
2012-05-03 15:49:27 -07:00
|
|
|
self['HOMEBREW_MAKE_JOBS'].to_i
|
2011-07-26 00:01:22 -05:00
|
|
|
else
|
2013-06-13 12:04:58 -05:00
|
|
|
Hardware::CPU.cores
|
2011-07-26 00:01:22 -05:00
|
|
|
end
|
|
|
|
end
|
2013-04-13 21:11:14 -05:00
|
|
|
|
|
|
|
# ld64 is a newer linker provided for Xcode 2.5
|
|
|
|
def ld64
|
|
|
|
ld64 = Formula.factory('ld64')
|
|
|
|
self['LD'] = ld64.bin/'ld'
|
|
|
|
append "LDFLAGS", "-B#{ld64.bin.to_s+"/"}"
|
|
|
|
end
|
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-11 12:30:51 -04:00
|
|
|
end
|