From 25daf1cf1e5f1872aa50cd0a0ec5ef959a0d4a0e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 3 Feb 2010 20:19:53 +0000 Subject: [PATCH] * 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35396 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/BuildSetup | 26 ++++++++++++----- src/libs/stdc++/current/Jamfile | 52 +++++++++------------------------ 2 files changed, 31 insertions(+), 47 deletions(-) diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index be28bf9344..3d373e85bd 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -402,23 +402,33 @@ HAIKU_PRIVATE_KERNEL_HEADERS = # 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 diff --git a/src/libs/stdc++/current/Jamfile b/src/libs/stdc++/current/Jamfile index 37f3fc041e..1a11b243f0 100644 --- a/src/libs/stdc++/current/Jamfile +++ b/src/libs/stdc++/current/Jamfile @@ -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 libstdc++.so from the libstdc++.a built with the compiler +if $(HAIKU_BUILD_SHARED_LIBSTDC++) { + CreateSharedC++LibraryFromArchive $(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 ; +if $(HAIKU_BUILD_SHARED_LIBSUPC++) { + CreateSharedC++LibraryFromArchive $(HAIKU_SHARED_LIBSUPC++) + : $(HAIKU_STATIC_LIBSUPC++) ; } - -CreateLibSupC++FromArchive $(HAIKU_SHARED_LIBSUPC++) - : $(HAIKU_STATIC_LIBSUPC++) ;