Support for adding libraries compiled with the alternative gcc (2 vs.

4). One has to have a (fully configured) "generated" directory for the
alternative gcc and specify it using the new option
"--alternative-gcc-output-dir" when configuring the main build.
Additionally the build variable HAIKU_ADD_ALTERNATIVE_GCC_LIBS has to be
set to "1".

If that has been done, when building the image a sub-jam is invoked that
generates the alternative libs and zips them. The main-jam unzips them
into the correct directory in the image. Note that the JAM build
variable has to be set when using a jam executable not invoked by "jam".

Tested with gcc 2 NetPositive, Pe, and FireFox under gcc 4 Haiku, and
with a few of the standard gcc 4 Haiku apps under gcc 2 Haiku. Seems to
work fine so far.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25536 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-05-17 23:47:39 +00:00
parent 3c504a317e
commit 9b0dd52858
4 changed files with 151 additions and 37 deletions
+85
View File
@@ -425,6 +425,91 @@ CopyDirectoryToHaikuImage beos etc
: licenses : -x .svn ;
#pragma mark - Alternative GCC Libraries
# build a zip file with the system libs
# (used by another jam that wants to build a Haiku with alternative GCC
# libraries included)
rule ZipTargets zipFile : targets
{
Depends $(zipFile) : <build>zip $(targets) ;
ZipTargets1 $(zipFile) : <build>zip $(targets) ;
}
actions ZipTargets1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(RM) "$(1)"
$(2[1]) -jy "$(1)" $(2[2-])
}
local alternativeSystemLibsZip = <image>alternative_system_libs.zip ;
MakeLocate $(alternativeSystemLibsZip) : $(HAIKU_OUTPUT_DIR) ;
# collect the targets we would install in the lib directory
local alternativeSystemLibs ;
local libTargets = [ FFilesInHaikuImageDirectory beos system lib ] ;
local libTarget ;
for libTarget in $(libTargets) {
alternativeSystemLibs += [ on $(libTarget) return $(TARGET) ] ;
}
# collect the symlinks we would install in the lib directory
libTargets = [ FSymlinksInHaikuImageDirectory beos system lib ] ;
local tmpAlternativeLibDir
= [ FDirName $(HAIKU_OUTPUT_DIR) tmp alternativeLibs ] ;
for libTarget in $(libTargets) {
# We need to create actual symlinks, we can zip later.
local symlinkTarget = <alternative-system-lib>$(libTarget:BS) ;
MakeLocate $(symlinkTarget) : $(tmpAlternativeLibDir) ;
SymLink $(symlinkTarget) : [ on $(libTarget) return $(SYMLINK_TARGET) ] ;
alternativeSystemLibs += $(symlinkTarget) ;
}
ZipTargets $(alternativeSystemLibsZip) : $(alternativeSystemLibs) ;
if $(HAIKU_ADD_ALTERNATIVE_GCC_LIBS) && $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) {
# let another jam build a zip with the system libraries
rule InvokeSubJam target : directory : jamLine
{
DIRECTORY on $(target) = $(directory) ;
COMMAND_LINE on $(target) = $(jamLine) ;
Always $(target) ;
InvokeSubJam1 $(target) ;
}
actions InvokeSubJam1
{
cd $(DIRECTORY)
$(JAM:E=jam) -q $(COMMAND_LINE) ;
}
local otherAlternativeSystemLibsZip
= <other-image>alternative_system_libs.zip ;
MakeLocate $(otherAlternativeSystemLibsZip)
: $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) ;
InvokeSubJam $(otherAlternativeSystemLibsZip)
: $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR)
: "'<image>alternative_system_libs.zip'" ;
local libSubDir ;
if $(HAIKU_GCC_VERSION[1]) = 2 {
libSubDir = gcc4 ;
} else {
libSubDir = gcc2 ;
}
# install the alternative libs in the right directory
UnzipArchiveToHaikuImage beos system lib $(libSubDir)
: $(otherAlternativeSystemLibsZip) ;
}
#pragma mark - Optional Packages
+7
View File
@@ -128,6 +128,13 @@ AddOptionalHaikuImagePackages WonderBrush ;
# Add all available optional packages.
HAIKU_ADD_ALL_OPTIONAL_PACKAGES = 1 ;
# Add the libraries built with the alternative gcc version. The alternative
# gcc generated directory must have specified via the configure option
# --alternative-gcc-output-dir. Note, that a sub-jam will be executed. When
# using a jam that is not simply invoked by "jam", set the JAM build variable
# accordingly.
HAIKU_ADD_ALTERNATIVE_GCC_LIBS = 1 ;
# Specify scripts that shall be run when populating the image/installation
# directory. The "early" script is run before anything has been copied onto
# the image/into the installation directory. The "late" script is run after
+3
View File
@@ -32,3 +32,6 @@
# Add all available optional packages.
#HAIKU_ADD_ALL_OPTIONAL_PACKAGES = 1 ;
# Add the libraries built with the alternative gcc version.
#HAIKU_ADD_ALTERNATIVE_GCC_LIBS = 1 ;