* 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
This commit is contained in:
Ingo Weinhold 2010-02-03 20:19:53 +00:00
parent d8141a0e2a
commit 25daf1cf1e
2 changed files with 31 additions and 47 deletions

View File

@ -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

View File

@ -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++) ;