Boost logo

Boost-Build :

From: Craig Rodrigues (rodrigc_at_[hidden])
Date: 2005-05-25 16:45:44


On Wed, May 25, 2005 at 10:09:22AM +0400, Vladimir Prus wrote:
> if ! [ MATCH "(g[+][+])" : $(.GXX) ]
> {
> flags darwin C++FLAGS : -fcoalesce-templates ;
> }
>
> I guess the idea is to add "-fcoalesce-templates" only if compiler name is not
> g++-4.0? Can anybody clarify?

Oops, here is an update to my patch, I forgot to modules.peek the JAMUNAME.
I just tried this out out MacOS X 10.3.9 (g++ == 3.3 ) and MacOS X 10.4
(g++ == 4.0) and it did the right thing.

This is taken pretty much from the Boost V1 darwin-tools.jam file.

Index: darwin.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/darwin.jam,v
retrieving revision 1.10
diff -u -r1.10 darwin.jam
--- darwin.jam 27 Dec 2004 09:07:04 -0000 1.10
+++ darwin.jam 25 May 2005 21:37:07 -0000
@@ -29,16 +29,20 @@
gcc.init-link-flags darwin darwin $(condition) ;
}

-# 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 ;
+
+local JAMUNAME = [ modules.peek : JAMUNAME ] ;
+
+# GCC 4.0, the default compiler in Darwin 8.0.0, does not have
+# -fcoalesce-templates. GCC 3.3 needs it.
+if ! [ MATCH "(g[+][+])" : $(.GXX) ] && $(JAMUNAME[3]) < "8.0.0" ||
+ [ MATCH "(g[+][+]-3.3)" : $(.GXX) ]
+{
+ flags darwin.compile.c++ OPTIONS : -fcoalesce-templates ;
+}

flags darwin.link FRAMEWORK <framework> ;

-- 
Craig Rodrigues 
rodrigc_at_[hidden]
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk