From 455935db581ecf2ffde376ad2a926b4e74ba779b Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Thu, 6 Nov 2003 07:32:04 +0000 Subject: [PATCH] Incremental improvement to the darwin toolset. * Set the proper suffix for shared libraries * Added C and C++ compile options used in v1: -Wno-long-double, -no-cpp-precomp, and -fcoalesce-templates * Converted the link.dll rule to use the bundled libtool * Added support for linking to frameworks Patch from Christopher Currie. [SVN r20695] --- src/tools/darwin.jam | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/tools/darwin.jam b/src/tools/darwin.jam index 53dca48b9..af8225034 100644 --- a/src/tools/darwin.jam +++ b/src/tools/darwin.jam @@ -7,30 +7,47 @@ # 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 ; toolset.register darwin ; toolset.inherit darwin : gcc ; +# No additional initialization should be necessary rule init ( ) { } -flags darwin.link.dll OPTIONS : -Wl,-dynamic -nostartfiles -Wl,-dylib -Wl,-ldylib1.o ; +# Darwin has a different shared library suffix +type.set-generated-target-suffix SHARED_LIB : darwin : dylib ; + +feature framework : : free ; + +flags darwin.compile OPTIONS shared : -dynamic ; +flags darwin.compile OPTIONS : -Wno-long-double -no-cpp-precomp ; +flags darwin.compile.c++ OPTIONS : -fcoalesce-templates ; + +flags darwin.link 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 { - $(NAME:E=g++) $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) + $(NAME:E=g++) $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) +} + +rule link.dll +{ + _ on $(<) = " " ; } actions link.dll bind LIBRARIES { - ld -dynamic -m -r -d -o "$(<:S=.lo)" "$(>)" \ - && \ - $(NAME:E=g++) $(OPTIONS) -L"$(LINKPATH)" -o "$(<)" "$(<:S=.lo)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) \ - && \ - rm -f "$(<:S=.lo)" + $(NAME:E=g++) -dynamiclib $(OPTIONS) -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) -framework$(_)$(FRAMEWORK) } actions piecemeal archive