2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Files
build/v2/tools/darwin.jam
Vladimir Prus e7a2eff161 Improved MacOS X support for -fcoalesce-templates. Check for result
of gcc --dumpversion when deciding if we're using 4.0 or not.

Patch from Craig Rodrigues.


[SVN r30105]
2005-07-15 13:31:13 +00:00

70 lines
2.3 KiB
Plaintext

# Copyright (C) Christopher Currie 2003. Permission to copy, use,
# modify, sell and distribute this software is granted provided this
# copyright notice appears in all copies. This software is provided
# "as is" without express or implied warranty, and with no claim as to
# its suitability for any purpose.
# Please see http://article.gmane.org/gmane.comp.lib.boost.build/3389/
# for explanation why it's a separate toolset.
import feature : feature ;
import toolset : flags ;
import type ;
import common ;
import generators ;
toolset.register darwin ;
import gcc ;
toolset.inherit-generators darwin : gcc ;
generators.override builtin.lib-generator : darwin.prebuilt ;
generators.override darwin.searched-lib-generator : searched-lib-generator ;
toolset.inherit-rules darwin : gcc ;
toolset.inherit-flags darwin : gcc ;
# No additional initialization should be necessary
rule init ( version ? : command * : options * )
{
local condition = [ common.check-init-parameters darwin : version $(version) ] ;
local command = [ common.get-invocation-command darwin : g++ : $(command) ] ;
common.handle-options darwin : $(condition) : $(command) : $(options) ;
# GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
local gccversion = [ SHELL "$(command) -dumpversion" ] ;
if $(gccversion) < "4.0.0"
{
flags darwin.compile.c++ OPTIONS : -fcoalesce-templates ;
}
gcc.init-link-flags darwin darwin $(condition) ;
}
feature framework : : free ;
flags darwin.compile OPTIONS <link>shared : -dynamic ;
flags darwin.compile OPTIONS : -Wno-long-double -no-cpp-precomp ;
flags darwin.link FRAMEWORK <framework> ;
# This is flag is useful for debugging the link step
# uncomment to see what libtool is doing under the hood
# flags darwin.link.dll OPTIONS : -Wl,-v ;
_ = " " ;
actions link bind LIBRARIES
{
$(CONFIG_COMMAND) $(ST_OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS)
}
actions link.dll bind LIBRARIES
{
$(CONFIG_COMMAND) -dynamiclib -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) $(OPTIONS)
}
actions piecemeal archive
{
ar -c -r -s $(ARFLAGS) "$(<:T)" "$(>:T)"
}