mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 07:18:40 +01:00
c0e8cc1a13
The goal is to do hybrid builds in a single jam (instead of calling a sub-jam to build parts with the secondary tool chain). This changeset adds support to configure to prepare multiple tool chains. configure: * Merge option --build-cross-tools-gcc4 into --build-cross-tools. The option does now always require a packaging architecture parameter, i.e. x86_gcc2 for the legacy tool chain. * Multiple occurrences of the --build-cross-tools and --cross-tools-prefix options are allowed. The first one specifies the primary tool chain, the subsequent ones the secondary tool chains. * All architecture dependent jam variables are now suffixed with the name of the packaging architecture. The new HAIKU_PACKAGING_ARCHS contains the packaging architectures for the prepared tool chains. The first element is for the primary tool chain. * No longer generate a separate libgccObjects file. Just put the respective variable into BuildConfig as well. build_cross_tools[_gcc4]: * Replace the <haiku output dir> parameter by a <install dir> parameter. This allows to create different cross-tools directories. They are simply suffixed by the packaging architecture. Jamrules: * For the moment map the variables for the primary tool chain to the respective suffix-less variables, so that everything still works as before. The next step is to actually support the secondary tool chains in the jam build system. This will require quite a bit more butchering, though.
139 lines
4.7 KiB
Plaintext
139 lines
4.7 KiB
Plaintext
# Haiku Jamrules
|
|
|
|
# Main directories used by the build.
|
|
HAIKU_OUTPUT_DIR ?= [ FDirName $(HAIKU_TOP) generated ] ;
|
|
HAIKU_BUILD_OUTPUT_DIR = [ FDirName $(HAIKU_OUTPUT_DIR) build ] ;
|
|
HAIKU_BUILD_DIR = [ FDirName $(HAIKU_TOP) build ] ;
|
|
HAIKU_BUILD_RULES_DIR = [ FDirName $(HAIKU_BUILD_DIR) jam ] ;
|
|
HAIKU_OBJECT_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
objects ] ;
|
|
HAIKU_CATALOGS_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_DIR)
|
|
catalogs ] ;
|
|
HAIKU_COMMON_PLATFORM_OBJECT_DIR = [ FDirName $(HAIKU_OBJECT_DIR) common ] ;
|
|
HAIKU_DOWNLOAD_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
download ] ;
|
|
HAIKU_OPTIONAL_BUILD_PACKAGES_DIR = [ FDirName $(HAIKU_OUTPUT_DIR)
|
|
build_packages ] ;
|
|
|
|
# Cache files for header scanning and jamfile caching
|
|
HCACHEFILE = header_cache ;
|
|
JCACHEFILE = jamfile_cache ;
|
|
LOCATE on $(HCACHEFILE) $(JCACHEFILE) = $(HAIKU_BUILD_OUTPUT_DIR) ;
|
|
|
|
# include BuildConfig
|
|
local buildConfig = [ GLOB $(HAIKU_BUILD_OUTPUT_DIR) : BuildConfig ] ;
|
|
if ! $(buildConfig) {
|
|
ECHO "No `BuildConfig' found in $(HAIKU_BUILD_OUTPUT_DIR)!" ;
|
|
EXIT "Run ./configure in the source tree's root directory first!" ;
|
|
}
|
|
LOCATE on BuildConfig = $(HAIKU_BUILD_OUTPUT_DIR) ;
|
|
include BuildConfig ;
|
|
|
|
# Set simplified variables for primary architecture.
|
|
HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
|
|
local variable ;
|
|
for variable in
|
|
HAIKU_GCC_RAW_VERSION
|
|
HAIKU_GCC_MACHINE
|
|
HAIKU_GCC_LIB_DIR
|
|
HAIKU_GCC_HEADERS_DIR
|
|
HAIKU_GCC_LIBGCC
|
|
HAIKU_GCC_LIBGCC_OBJECTS
|
|
HAIKU_CPU
|
|
HAIKU_STATIC_LIBSTDC++
|
|
HAIKU_SHARED_LIBSTDC++
|
|
HAIKU_STATIC_LIBSUPC++
|
|
HAIKU_SHARED_LIBSUPC++
|
|
HAIKU_C++_HEADERS_DIR
|
|
HAIKU_KERNEL_LIBGCC
|
|
HAIKU_KERNEL_LIBSUPC++
|
|
HAIKU_BOOT_LIBGCC
|
|
HAIKU_BOOT_LIBSUPC++
|
|
HAIKU_AR
|
|
HAIKU_CC
|
|
HAIKU_LD
|
|
HAIKU_OBJCOPY
|
|
HAIKU_RANLIB
|
|
HAIKU_ELFEDIT
|
|
HAIKU_STRIP
|
|
HAIKU_CPPFLAGS
|
|
HAIKU_CCFLAGS
|
|
HAIKU_C++FLAGS
|
|
HAIKU_LDFLAGS
|
|
HAIKU_ARFLAGS
|
|
HAIKU_UNARFLAGS
|
|
HAIKU_USE_GCC_GRAPHITE {
|
|
$(variable) = $($(variable)_$(HAIKU_PACKAGING_ARCH)) ;
|
|
}
|
|
|
|
# The build setup and rules are neatly organized in several files. Include
|
|
# them now. Start with the side-effect-less rules, since they are the most
|
|
# likely to be used in the top level context (i.e. not only in rules).
|
|
# At the end include BuildSetup that sets up global variables etc. The
|
|
# optional user-defined UserBuildConfig is included thereafter.
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HelperRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MathRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) LocaleRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CommandLineArguments ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ConfigRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) DocumentationRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) FileRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) HeadersRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) KernelRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BootRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) ImageRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MainBuildRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) MiscRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) OverriddenJamRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) PackageRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) RepositoryRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) TestsRules ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildSetup ] ;
|
|
include [ FDirName $(HAIKU_BUILD_RULES_DIR) DefaultBuildProfiles ] ;
|
|
|
|
# Include the repositories for this architecture.
|
|
local repositoriesDirectory
|
|
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
|
|
local repositories = HaikuPorts ;
|
|
if $(HAIKU_BOOTSTRAP_BUILD) {
|
|
repositories = HaikuPortsCross ;
|
|
}
|
|
|
|
local repository ;
|
|
for repository in $(repositories) {
|
|
local repositoryDirectory
|
|
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
|
|
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
|
|
if $(file) {
|
|
HAIKU_REPOSITORY_JAMFILE = $(file) ;
|
|
include $(file) ;
|
|
}
|
|
}
|
|
|
|
# Declare no-op user-overridable build rules.
|
|
rule UserBuildConfigRulePostBuildTargets { }
|
|
rule UserBuildConfigRulePreImage { }
|
|
rule UserBuildConfigRulePostImage { }
|
|
|
|
# Include UserBuildConfig.
|
|
if ! $(HAIKU_IGNORE_USER_BUILD_CONFIG) {
|
|
local userBuildConfig
|
|
= [ GLOB $(HAIKU_BUILD_RULES_DIR) : UserBuildConfig ] ;
|
|
if $(userBuildConfig) {
|
|
include $(userBuildConfig) ;
|
|
}
|
|
|
|
# allow for a separate UserBuildConfig per output directory
|
|
local userBuildConfig
|
|
= [ GLOB $(HAIKU_OUTPUT_DIR) : UserBuildConfig ] ;
|
|
if $(userBuildConfig) {
|
|
include $(userBuildConfig) ;
|
|
}
|
|
}
|
|
|
|
DefineDefaultBuildProfiles ;
|
|
|
|
PrepareConfigVariables ;
|