haiku/Jamrules

107 lines
4.2 KiB
Plaintext
Raw Normal View History

# 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 HAIKU_PACKAGING_ARCH, the primary packaging architecture
2013-07-26 01:52:11 +04:00
HAIKU_PACKAGING_ARCH = $(HAIKU_PACKAGING_ARCHS[1]) ;
# 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) ArchitectureRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BeOSRules ] ;
include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatureRules ] ;
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 ] ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
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 ] ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
# Include the repositories for this architecture.
local repositoriesDirectory
= [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories ] ;
Integrate building the HaikuPorts bootstrap packages * Add configure option --bootstrap which allows specifying the haikuporter and HaikuPorts repository paths. * Add rules for supporting a second repository type. The PackageRepository rule is now private and RemotePackageRepository is used for remote repositories. The new BootstrapPackageRepository rule is for defining a bootstrap repository (there will probably be only the HaikuPorts cross repository) whose packages can be built as needed via haikuporter. * Rename DownloadPackage to FetchPackage. * Define repository HaikuPortsCross. * HaikuCrossDevel package(s): There are now two sets of packages: A "stage1" set with the same content as before and a final set additionally containing the libraries libbe, libnetwork, libpackage. Those are needed for building the libsolv bootstrap package while for building them we need other bootstrap packages (ICU, libz). This is basically all that's required to build a bootstrap Haiku completely from sources, with a few caveats: * There's no ICU bootstrap recipe yet (so one has to cheat and use the prebuilt package ATM). * Probably doesn't work on Haiku yet (tested on Linux only). * A 32 bit environment must be used (otherwise building the gcc 2 bootstrap package fails). * Building with multiple jobs doesn't work yet, since haikuporter uses common directories for building different packages and there's no explicit serialization yet. * Haven't tested the resulting image save for booting it. So it probably needs a bit more work before it can actually build the final HaikuPorts packages.
2013-07-21 06:10:48 +04:00
local repositories = HaikuPorts ;
if $(HAIKU_BOOTSTRAP_BUILD) {
repositories = HaikuPortsCross ;
}
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
local repository ;
Integrate building the HaikuPorts bootstrap packages * Add configure option --bootstrap which allows specifying the haikuporter and HaikuPorts repository paths. * Add rules for supporting a second repository type. The PackageRepository rule is now private and RemotePackageRepository is used for remote repositories. The new BootstrapPackageRepository rule is for defining a bootstrap repository (there will probably be only the HaikuPorts cross repository) whose packages can be built as needed via haikuporter. * Rename DownloadPackage to FetchPackage. * Define repository HaikuPortsCross. * HaikuCrossDevel package(s): There are now two sets of packages: A "stage1" set with the same content as before and a final set additionally containing the libraries libbe, libnetwork, libpackage. Those are needed for building the libsolv bootstrap package while for building them we need other bootstrap packages (ICU, libz). This is basically all that's required to build a bootstrap Haiku completely from sources, with a few caveats: * There's no ICU bootstrap recipe yet (so one has to cheat and use the prebuilt package ATM). * Probably doesn't work on Haiku yet (tested on Linux only). * A 32 bit environment must be used (otherwise building the gcc 2 bootstrap package fails). * Building with multiple jobs doesn't work yet, since haikuporter uses common directories for building different packages and there's no explicit serialization yet. * Haven't tested the resulting image save for booting it. So it probably needs a bit more work before it can actually build the final HaikuPorts packages.
2013-07-21 06:10:48 +04:00
for repository in $(repositories) {
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
local repositoryDirectory
= [ FDirName $(repositoriesDirectory) $(repository) ] ;
local file = [ Glob $(repositoryDirectory) : $(HAIKU_PACKAGING_ARCH) ] ;
if $(file) {
HAIKU_REPOSITORY_JAMFILE = $(file) ;
Switch build system from optional package to repositories * Build libsolv and the dependency solver part of the package kit for the build platform. * Add build tool get_package_dependencies. Given a list of package files and a list of repository files it determines the additional packages that need to be retrieved from the repositories and prints their URLs. * Add rules to work with external repositories in the build system (build/jam/RepositoryRules): - PackageRepository declares an external repository with all its packages. The URL of the repository file isn't specified. It is computed from a given base URL and the SHA256 hash of the list of package files. - GeneratedRepositoryPackageList generates a file containing the file names of all packages in a repository. - IsPackageAvailable returns whether a package is available in any repository. - PackageURL returns the URL for a package. * Declare the HaikuPorts repository for x86_gcc2 (build/jam/repositories/HaikuPorts/x86_gcc2). * Add rule AddHaikuImagePackages to add a package to the image and rule IsHaikuImagePackageAdded to determine whether a package has been added. * OptionalPackages: Remove all entries that just downloaded and installed an external package. AddHaikuImagePackages can be used instead and is used in the remaining entries. Also move the remaining optional package dependency declarations from OptionalPackageDependencies here. * ExtractBuildFeatureArchives: Instead of the URL parameter a package name must be specified now. This allows to simplify BuildFeatures significantly, since there's no dealing with URLs anymore. "if" out the entries that aren't supported yet. * build_haiku_image: For the packages installed in system and common resolve their dependencies and download and install them as well.
2013-07-05 12:51:42 +04:00
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 ;