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 0ec36774c0 Move 'OPTION' to the end of link action for unix toolset.
In particular, this allows to explicitly link statically to some
libs, using <linkflags> feature. In static libs are specified at
the beginning of the command line, we'll just get link errors.


[SVN r25548]
2004-10-04 07:29:49 +00:00

71 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 ;
toolset.register darwin ;
import gcc ;
toolset.inherit-generators darwin : gcc ;
# we can't pass -s to ld unless we also pass -static
# so we removed -s completly from OPTIONS and add it
# to ST_OPTIONS
toolset.inherit-flags darwin : gcc : <debug-symbols>off ;
toolset.inherit-rules darwin : gcc ;
flags darwin.link ST_OPTIONS <debug-symbols>off : -s ;
# No additional initialization should be necessary
rule init ( version ? : command * )
{
local condition = [ common.check-init-parameters darwin : version $(version) ] ;
local command = [ common.get-invocation-command darwin : g++ : $(command) ] ;
flags darwin CONFIG_COMMAND $(condition) : $(command) ;
}
# Darwin has a different shared library suffix
type.set-generated-target-suffix SHARED_LIB : <toolset>darwin : dylib ;
# we need to be able to tell the type of .dylib files
type.register-suffixes dylib : SHARED_LIB ;
feature framework : : free ;
flags darwin.compile OPTIONS <link>shared : -dynamic ;
flags darwin.compile OPTIONS : -Wno-long-double -no-cpp-precomp ;
flags darwin.compile.c++ OPTIONS : -fcoalesce-templates ;
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)
}
rule link.dll
{
_ on $(<) = " " ;
}
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)"
}