[haiku-commits] r35396 - in haiku/trunk: build/jam src/libs/stdc++/current

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 3 Feb 2010 21:19:54 +0100 (CET)

Author: bonefish
Date: 2010-02-03 21:19:53 +0100 (Wed, 03 Feb 2010)
New Revision: 35396
Changeset: http://dev.haiku-os.org/changeset/35396/haiku
Ticket: http://dev.haiku-os.org/ticket/5322

Modified:
   haiku/trunk/build/jam/BuildSetup
   haiku/trunk/src/libs/stdc++/current/Jamfile
Log:
* Build libsupc++.so and libstdc++.so only when they aren't provided by the
  compiler. Fixes #5322 (the ones in /boot/develop would be overwritten).
* Simplified the Jamfile building these libraries.


Modified: haiku/trunk/build/jam/BuildSetup
===================================================================
--- haiku/trunk/build/jam/BuildSetup    2010-02-03 19:05:30 UTC (rev 35395)
+++ haiku/trunk/build/jam/BuildSetup    2010-02-03 20:19:53 UTC (rev 35396)
@@ -402,23 +402,33 @@
 # Add some grist to the libgcc objects
 HAIKU_GCC_LIBGCC_OBJECTS = $(HAIKU_GCC_LIBGCC_OBJECTS:G=libgcc) ;
 
-# the C++ library
+# the C++ standard library
+HAIKU_BUILD_SHARED_LIBSTDC++ = ;
 if $(HAIKU_SHARED_LIBSTDC++) {
        HAIKU_LIBSTDC++ = $(HAIKU_SHARED_LIBSTDC++) ;
-} else if $(HAIKU_STATIC_LIBSTDC++) {
-       HAIKU_LIBSTDC++ = $(HAIKU_STATIC_LIBSTDC++) ;
 } else {
-       HAIKU_LIBSTDC++ = libstdc++.r4.so ;
+       # no shared library available with the compiler -- build it
+       if $(HAIKU_GCC_VERSION[1]) = 2 {
+               HAIKU_LIBSTDC++ = libstdc++.r4.so ;
+       } else {
+               HAIKU_LIBSTDC++ = libstdc++.so ;
+       }
        HAIKU_SHARED_LIBSTDC++ = $(HAIKU_LIBSTDC++) ;
+       HAIKU_BUILD_SHARED_LIBSTDC++ = 1 ;
 }
 
-# the C++ support library
+# the C++ support (runtime) library
+HAIKU_BUILD_SHARED_LIBSUPC++ = ;
 if $(HAIKU_SHARED_LIBSUPC++) {
        HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
-} else if $(HAIKU_STATIC_LIBSUPC++) {
-       HAIKU_LIBSUPC++ = $(HAIKU_STATIC_LIBSUPC++) ;
 } else {
-       HAIKU_LIBSUPC++ = ;
+       # no shared library available with the compiler -- build it for gcc 4
+       if $(HAIKU_GCC_VERSION[1]) != 2 {
+               HAIKU_SHARED_LIBSUPC++ = libsupc++.so ;
+               HAIKU_BUILD_SHARED_LIBSUPC++ = 1 ;
+       }
+
+       HAIKU_LIBSUPC++ = $(HAIKU_SHARED_LIBSUPC++) ;
 }
 
 # network libraries

Modified: haiku/trunk/src/libs/stdc++/current/Jamfile
===================================================================
--- haiku/trunk/src/libs/stdc++/current/Jamfile 2010-02-03 19:05:30 UTC (rev 
35395)
+++ haiku/trunk/src/libs/stdc++/current/Jamfile 2010-02-03 20:19:53 UTC (rev 
35396)
@@ -1,49 +1,23 @@
 SubDir HAIKU_TOP src libs stdc++ current ;
 
 
-
-# create libstdc++.so from the libstdc++.a build with the compiler
-rule CreateLibStdC++FromArchive
+rule CreateSharedC++LibraryFromArchive sharedLib : staticLib
 {
-       local _lib = $(1) ;
-       local neededLibs ;
-       
-       if ! [ IsPlatformSupportedForTarget $(1) ] {
-               return ;
-       }
+       LINKFLAGS on $(sharedLib) = [ on $(sharedLib) return $(LINKFLAGS) ]
+               -Xlinker --strip-debug -Xlinker --whole-archive ;
 
-       MainFromObjects $(_lib) : $(2) ;
-       LINKFLAGS on $(_lib) = [ on $(_lib) return $(LINKFLAGS) ]
-               -nostart -Xlinker -soname=\"$(_lib:G=)\" 
-               -Xlinker --strip-debug
-               -Xlinker --whole-archive ;
-       LinkAgainst $(_lib) : $(3) ;
-
-       AddSharedObjectGlueCode $(_lib) : false ;
+       SharedLibraryFromObjects $(sharedLib) : : $(staticLib) ;
 }
 
-CreateLibStdC++FromArchive $(HAIKU_SHARED_LIBSTDC++) 
-       : $(HAIKU_STATIC_LIBSTDC++) ;
 
-# create libsupc++.so from the libsupc++.a build with the compiler
-rule CreateLibSupC++FromArchive
-{
-       local _lib = $(1) ;
-       local neededLibs ;
-       
-       if ! [ IsPlatformSupportedForTarget $(1) ] {
-               return ;
-       }
-
-       MainFromObjects $(_lib) : $(2) ;
-       LINKFLAGS on $(_lib) = [ on $(_lib) return $(LINKFLAGS) ]
-               -nostart -Xlinker -soname=\"$(_lib:G=)\" 
-               -Xlinker --strip-debug
-               -Xlinker --whole-archive ;
-       LinkAgainst $(_lib) : $(3) ;
-
-       AddSharedObjectGlueCode $(_lib) : false ;
+# create libstdc++.so from the libstdc++.a built with the compiler
+if $(HAIKU_BUILD_SHARED_LIBSTDC++) {
+       CreateSharedC++LibraryFromArchive $(HAIKU_SHARED_LIBSTDC++)
+               : $(HAIKU_STATIC_LIBSTDC++) ;
 }
 
-CreateLibSupC++FromArchive $(HAIKU_SHARED_LIBSUPC++) 
-       : $(HAIKU_STATIC_LIBSUPC++) ;
+# create libsupc++.so from the libsupc++.a build with the compiler
+if $(HAIKU_BUILD_SHARED_LIBSUPC++) {
+       CreateSharedC++LibraryFromArchive $(HAIKU_SHARED_LIBSUPC++)
+               : $(HAIKU_STATIC_LIBSUPC++) ;
+}


Other related posts:

  • » [haiku-commits] r35396 - in haiku/trunk: build/jam src/libs/stdc++/current - ingo_weinhold