build features/bootstrap repo: support secondary arch
* Add rule FSplitPackageName. It splits a package name into port name and package suffix. * FSetConditionsHold: Rename to FConditionsHold and replace the set parameter by a predicate rule parameter, thus adding more flexibility. * FIsBuildFeatureEnabled: Use the faster check. * Add rule FQualifiedBuildFeatureName. Given a build feature name, it prepends the current packaging architecture to yield a qualified feature name. Is used by the other build feature rules so that the same build feature can be configured differently for each arch. * ExtractBuildFeatureArchives: The supplied list is now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the list. * Add rule InitArchitectureBuildFeatures. It is called early for each configured architecture, setting up some basic build features for it. "primary" is set for the primary architecture and a "secondary_<arch>" is set for each secondary architecture. * BuildFeatures: Add secondary architecture support: Use the correct paths for libraries and headers (subdir for secondary architecture) and configure the icu and zlib sources only for the primary architecture. * BootstrapPackageRepository: The package lists are now filtered via FFilterByBuildFeatures, allowing for build feature conditions in the lists. * IsPackageAvailable, FetchPackage: Add secondary architecture support. * HaikuPortsCross/x86_gcc2: Add icu and zlib x86 secondary packages. The second stage Haiku cross devel package for the secondary architecture can now be built.
This commit is contained in:
+55
-18
@@ -1,3 +1,14 @@
|
|||||||
|
rule FQualifiedBuildFeatureName features
|
||||||
|
{
|
||||||
|
# FQualifiedBuildFeatureName <features>
|
||||||
|
#
|
||||||
|
# Prepends the name of the current target packaging architecture to the
|
||||||
|
# given feature names.
|
||||||
|
|
||||||
|
return $(TARGET_PACKAGING_ARCH):$(features) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rule FIsBuildFeatureEnabled feature
|
rule FIsBuildFeatureEnabled feature
|
||||||
{
|
{
|
||||||
# FIsBuildFeatureEnabled <feature> ;
|
# FIsBuildFeatureEnabled <feature> ;
|
||||||
@@ -6,11 +17,8 @@ rule FIsBuildFeatureEnabled feature
|
|||||||
#
|
#
|
||||||
# <feature> - The name of the build feature (all lower case).
|
# <feature> - The name of the build feature (all lower case).
|
||||||
|
|
||||||
if $(feature) in $(HAIKU_BUILD_FEATURES) {
|
feature = [ FQualifiedBuildFeatureName $(feature) ] ;
|
||||||
return 1 ;
|
return $(HAIKU_BUILD_FEATURE_$(feature:U)_ENABLED) ;
|
||||||
}
|
|
||||||
|
|
||||||
return ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -39,8 +47,7 @@ rule FMatchesBuildFeatures specification
|
|||||||
for element in $(specification) {
|
for element in $(specification) {
|
||||||
splitSpecification += [ FSplitString $(element) : "," ] ;
|
splitSpecification += [ FSplitString $(element) : "," ] ;
|
||||||
}
|
}
|
||||||
return [ FSetConditionsHold $(splitSpecification)
|
return [ FConditionsHold $(splitSpecification) : FIsBuildFeatureEnabled ] ;
|
||||||
: $(HAIKU_BUILD_FEATURES) ] ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -146,9 +153,10 @@ rule EnableBuildFeatures features : specification
|
|||||||
# <specification> - An optional build features specification (cf.
|
# <specification> - An optional build features specification (cf.
|
||||||
# FMatchesBuildFeatures).
|
# FMatchesBuildFeatures).
|
||||||
|
|
||||||
|
features = [ FQualifiedBuildFeatureName $(features) ] ;
|
||||||
|
|
||||||
if ! $(specification)
|
if ! $(specification)
|
||||||
|| [ FMatchesBuildFeatures $(specification)
|
|| [ FMatchesBuildFeatures $(specification) ] {
|
||||||
: $(HAIKU_BUILD_FEATURES) ] {
|
|
||||||
local feature ;
|
local feature ;
|
||||||
for feature in $(features) {
|
for feature in $(features) {
|
||||||
HAIKU_BUILD_FEATURES += $(feature) ;
|
HAIKU_BUILD_FEATURES += $(feature) ;
|
||||||
@@ -164,6 +172,8 @@ rule BuildFeatureObject feature
|
|||||||
# Returns a unique object for the given build feature. It is used for
|
# Returns a unique object for the given build feature. It is used for
|
||||||
# attaching attribute values to it.
|
# attaching attribute values to it.
|
||||||
|
|
||||||
|
feature = [ FQualifiedBuildFeatureName $(feature) ] ;
|
||||||
|
|
||||||
local featureObject = $(HAIKU_BUILD_FEATURE_$(feature:U)) ;
|
local featureObject = $(HAIKU_BUILD_FEATURE_$(feature:U)) ;
|
||||||
if ! $(featureObject) {
|
if ! $(featureObject) {
|
||||||
featureObject = [ NewUniqueTarget ] ;
|
featureObject = [ NewUniqueTarget ] ;
|
||||||
@@ -286,14 +296,8 @@ rule ExtractBuildFeatureArchivesExpandValue value : fileName
|
|||||||
}
|
}
|
||||||
|
|
||||||
# get the port name from the package name
|
# get the port name from the package name
|
||||||
splitName = [ Match "(.*)_([^_]*)" : $(%packageName%) ] ;
|
splitName = [ FSplitPackageName $(%packageName%) ] ;
|
||||||
local knownPackageSuffixes = devel doc source debuginfo ;
|
%portName% = $(splitName[1]) ;
|
||||||
if $(splitName[2])
|
|
||||||
&& $(splitName[2]) in $(knownPackageSuffixes) {
|
|
||||||
%portName% = $(splitName[1]) ;
|
|
||||||
} else {
|
|
||||||
%portName% = $(%packageName%) ;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
value = "$(value)$($(component):E=)" ;
|
value = "$(value)$($(component):E=)" ;
|
||||||
@@ -349,6 +353,9 @@ rule ExtractBuildFeatureArchives feature : list
|
|||||||
# The rule also sets the build feature attribute "<packageAlias>:directory"
|
# The rule also sets the build feature attribute "<packageAlias>:directory"
|
||||||
# to the extraction directory for each package.
|
# to the extraction directory for each package.
|
||||||
|
|
||||||
|
local qualifiedFeature = [ FQualifiedBuildFeatureName $(feature) ] ;
|
||||||
|
list = [ FFilterByBuildFeatures $(list) ] ;
|
||||||
|
|
||||||
while $(list) {
|
while $(list) {
|
||||||
if $(list[1]) != file: {
|
if $(list[1]) != file: {
|
||||||
Exit "ExtractBuildFeatureArchives: Expected \"file: ...\", got:"
|
Exit "ExtractBuildFeatureArchives: Expected \"file: ...\", got:"
|
||||||
@@ -405,7 +412,7 @@ rule ExtractBuildFeatureArchives feature : list
|
|||||||
SetBuildFeatureAttribute $(feature) : $(attribute)
|
SetBuildFeatureAttribute $(feature) : $(attribute)
|
||||||
: [ ExtractArchive $(directory)
|
: [ ExtractArchive $(directory)
|
||||||
: $(values) : $(file)
|
: $(values) : $(file)
|
||||||
: extracted-$(feature)-$(package) ] ;
|
: extracted-$(qualifiedFeature)-$(package) ] ;
|
||||||
SetBuildFeatureAttribute $(feature) : $(attribute):package
|
SetBuildFeatureAttribute $(feature) : $(attribute):package
|
||||||
: $(package) ;
|
: $(package) ;
|
||||||
}
|
}
|
||||||
@@ -415,3 +422,33 @@ rule ExtractBuildFeatureArchives feature : list
|
|||||||
: $(directory:G=) ;
|
: $(directory:G=) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
rule InitArchitectureBuildFeatures architecture
|
||||||
|
{
|
||||||
|
# InitArchitectureBuildFeatures <architecture> ;
|
||||||
|
#
|
||||||
|
# Enable the build features that can be derived directly from the
|
||||||
|
# architecture.
|
||||||
|
|
||||||
|
# The build feature rule use TARGET_PACKAGING_ARCH, so set that temporarily.
|
||||||
|
local savedArchitecture = $(TARGET_PACKAGING_ARCH) ;
|
||||||
|
TARGET_PACKAGING_ARCH = $(architecture) ;
|
||||||
|
|
||||||
|
# Add the target architecture as a build feature.
|
||||||
|
EnableBuildFeatures $(TARGET_ARCH_$(architecture)) ;
|
||||||
|
|
||||||
|
# For the primary architecture add the "primary" build feature.
|
||||||
|
if $(architecture) = $(TARGET_PACKAGING_ARCHS[1]) {
|
||||||
|
EnableBuildFeatures primary ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add all secondary architectures as build features (with prefix).
|
||||||
|
EnableBuildFeatures secondary_$(TARGET_PACKAGING_ARCHS[2-]) ;
|
||||||
|
|
||||||
|
if $(TARGET_GCC_VERSION_$(architecture)[1]) = 2 {
|
||||||
|
EnableBuildFeatures gcc2 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
TARGET_PACKAGING_ARCH = $(savedArchitecture) ;
|
||||||
|
}
|
||||||
|
|||||||
+52
-52
@@ -1,22 +1,12 @@
|
|||||||
# This file contains setup for build features that are not available for all
|
# This file contains setup for build features that require external packages. It
|
||||||
# architectures/setups or that are optional for the build. For features that
|
# is included once for each configured packaging architecture (with
|
||||||
# require downloading a zip file from somewhere it is likely the same file used
|
# TARGET_PACKAGING_ARCH set accordingly).
|
||||||
# for an optional package.
|
|
||||||
|
|
||||||
|
|
||||||
local architecture = $(TARGET_PACKAGING_ARCH) ;
|
local architecture = $(TARGET_PACKAGING_ARCH) ;
|
||||||
|
local secondaryArchSubDir = [ MultiArchIfPrimary "" : /$(architecture) ] ;
|
||||||
|
local developLibDir = develop/lib$(secondaryArchSubDir) ;
|
||||||
# Add the target architecture as a build feature.
|
local developHeadersDir = develop/headers$(secondaryArchSubDir) ;
|
||||||
EnableBuildFeatures $(TARGET_ARCH_$(architecture)) ;
|
|
||||||
|
|
||||||
if $(TARGET_GCC_VERSION_$(architecture)[1]) = 2 {
|
|
||||||
EnableBuildFeatures gcc2 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
local baseURL = http://www.haiku-files.org/files/optional-packages ;
|
|
||||||
local hpkgBaseURL = http://haiku-files.org/files/hpkg ;
|
|
||||||
|
|
||||||
|
|
||||||
# SSL
|
# SSL
|
||||||
@@ -33,8 +23,10 @@ if $(HAIKU_BUILD_FEATURE_SSL) {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel openssl_devel
|
file: devel openssl_devel
|
||||||
depends: base
|
depends: base
|
||||||
libraries: develop/lib/libcrypto.so develop/lib/libssl.so
|
libraries:
|
||||||
headers: develop/headers
|
$(developLibDir)/libcrypto.so
|
||||||
|
$(developLibDir)/libssl.so
|
||||||
|
headers: $(developHeadersDir)
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures openssl ;
|
EnableBuildFeatures openssl ;
|
||||||
@@ -54,14 +46,14 @@ if [ IsPackageAvailable icu_devel ] {
|
|||||||
file: devel icu_devel
|
file: devel icu_devel
|
||||||
depends: base
|
depends: base
|
||||||
libraries:
|
libraries:
|
||||||
develop/lib/libicudata.so
|
$(developLibDir)/libicudata.so
|
||||||
develop/lib/libicui18n.so
|
$(developLibDir)/libicui18n.so
|
||||||
develop/lib/libicuio.so
|
$(developLibDir)/libicuio.so
|
||||||
develop/lib/libicule.so
|
$(developLibDir)/libicule.so
|
||||||
develop/lib/libiculx.so
|
$(developLibDir)/libiculx.so
|
||||||
develop/lib/libicutu.so
|
$(developLibDir)/libicutu.so
|
||||||
develop/lib/libicuuc.so
|
$(developLibDir)/libicuuc.so
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures icu ;
|
EnableBuildFeatures icu ;
|
||||||
@@ -244,8 +236,8 @@ if [ IsPackageAvailable glu_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel glu_devel
|
file: devel glu_devel
|
||||||
depends: base
|
depends: base
|
||||||
library: develop/lib/libGLU.so
|
library: $(developLibDir)/libGLU.so
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures glu ;
|
EnableBuildFeatures glu ;
|
||||||
@@ -258,19 +250,19 @@ if [ IsPackageAvailable glu_devel ] {
|
|||||||
if [ IsPackageAvailable mesa_devel ] {
|
if [ IsPackageAvailable mesa_devel ] {
|
||||||
ExtractBuildFeatureArchives mesa : [ FFilterByBuildFeatures
|
ExtractBuildFeatureArchives mesa : [ FFilterByBuildFeatures
|
||||||
file: devel mesa_devel
|
file: devel mesa_devel
|
||||||
mesaLibrary: develop/lib/libmesa.a
|
mesaLibrary: $(developLibDir)/libmesa.a
|
||||||
glapiLibrary: develop/lib/libglapi.a
|
glapiLibrary: $(developLibDir)/libglapi.a
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
privateHeaders: develop/headers/mesa_private
|
privateHeaders: $(developHeadersDir)/mesa_private
|
||||||
|
|
||||||
!gcc2 @{
|
!gcc2 @{
|
||||||
glslLibrary: develop/lib/libglsl.a
|
glslLibrary: $(developLibDir)/libglsl.a
|
||||||
galliumLibrary: develop/lib/libgallium.a
|
galliumLibrary: $(developLibDir)/libgallium.a
|
||||||
llvm @{
|
llvm @{
|
||||||
galliumLlvmpipeLibrary: develop/lib/libllvmpipe.a
|
galliumLlvmpipeLibrary: $(developLibDir)/libllvmpipe.a
|
||||||
}@
|
}@
|
||||||
!llvm @{
|
!llvm @{
|
||||||
galliumSoftpipeLibrary: develop/lib/libsoftpipe.a
|
galliumSoftpipeLibrary: $(developLibDir)/libsoftpipe.a
|
||||||
}@
|
}@
|
||||||
}@ # !gcc2
|
}@ # !gcc2
|
||||||
] ;
|
] ;
|
||||||
@@ -301,8 +293,8 @@ if [ IsPackageAvailable ffmpeg_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel $(feature)_devel
|
file: devel $(feature)_devel
|
||||||
depends: base
|
depends: base
|
||||||
libraries: develop/lib/$($(feature)Libs)
|
libraries: $(developLibDir)/$($(feature)Libs)
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures $(feature) ;
|
EnableBuildFeatures $(feature) ;
|
||||||
@@ -319,8 +311,8 @@ if [ IsPackageAvailable freetype_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel freetype_devel
|
file: devel freetype_devel
|
||||||
depends: base
|
depends: base
|
||||||
library: develop/lib/libfreetype.so
|
library: $(developLibDir)/libfreetype.so
|
||||||
headers: develop/headers develop/headers/freetype2
|
headers: $(developHeadersDir) $(developHeadersDir)/freetype2
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures freetype ;
|
EnableBuildFeatures freetype ;
|
||||||
@@ -442,8 +434,8 @@ if [ IsPackageAvailable libpng_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel libpng_devel
|
file: devel libpng_devel
|
||||||
depends: base
|
depends: base
|
||||||
library: develop/lib/libpng.so
|
library: $(developLibDir)/libpng.so
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures libpng ;
|
EnableBuildFeatures libpng ;
|
||||||
@@ -459,8 +451,8 @@ if [ IsPackageAvailable jpeg_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel jpeg_devel
|
file: devel jpeg_devel
|
||||||
depends: base
|
depends: base
|
||||||
library: develop/lib/libjpeg.so
|
library: $(developLibDir)/libjpeg.so
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures jpeg ;
|
EnableBuildFeatures jpeg ;
|
||||||
@@ -476,10 +468,13 @@ if [ IsPackageAvailable zlib_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel zlib_devel
|
file: devel zlib_devel
|
||||||
depends: base
|
depends: base
|
||||||
library: develop/lib/libz.so
|
library: $(developLibDir)/libz.so
|
||||||
headers: develop/headers
|
headers: $(developHeadersDir)
|
||||||
file: source zlib_source
|
# sources are required for the primary architecture only
|
||||||
sources: develop/sources/%portRevisionedName%/source
|
primary @{
|
||||||
|
file: source zlib_source
|
||||||
|
sources: develop/sources/%portRevisionedName%/source
|
||||||
|
}@
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures zlib ;
|
EnableBuildFeatures zlib ;
|
||||||
@@ -495,10 +490,15 @@ if [ IsPackageAvailable libsolv_devel ] {
|
|||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel libsolv_devel
|
file: devel libsolv_devel
|
||||||
depends: base
|
depends: base
|
||||||
libraries: develop/lib/libsolv.so develop/lib/libsolvext.so
|
libraries:
|
||||||
headers: develop/headers
|
$(developLibDir)/libsolv.so
|
||||||
file: source libsolv_source
|
$(developLibDir)/libsolvext.so
|
||||||
sources: develop/sources/%portRevisionedName%/source
|
headers: $(developHeadersDir)
|
||||||
|
# sources are required for the primary architecture only
|
||||||
|
primary @{
|
||||||
|
file: source libsolv_source
|
||||||
|
sources: develop/sources/%portRevisionedName%/source
|
||||||
|
}@
|
||||||
;
|
;
|
||||||
|
|
||||||
EnableBuildFeatures libsolv ;
|
EnableBuildFeatures libsolv ;
|
||||||
|
|||||||
@@ -900,6 +900,13 @@ for architecture in $(TARGET_PACKAGING_ARCHS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# set up architecture build features
|
||||||
|
local architecture ;
|
||||||
|
for architecture in $(TARGET_PACKAGING_ARCHS) {
|
||||||
|
InitArchitectureBuildFeatures $(architecture) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# The following directories cannot currently be compiled with DEBUG=1
|
# The following directories cannot currently be compiled with DEBUG=1
|
||||||
SetConfigVar DEBUG : HAIKU_TOP src add-ons disk_systems bfs : 0 : local ;
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons disk_systems bfs : 0 : local ;
|
||||||
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio hda : 0 : local ;
|
SetConfigVar DEBUG : HAIKU_TOP src add-ons kernel drivers audio hda : 0 : local ;
|
||||||
|
|||||||
+16
-14
@@ -97,26 +97,28 @@ rule FSplitPath
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
rule FSetConditionsHold conditions : set
|
rule FConditionsHold conditions : predicate
|
||||||
{
|
{
|
||||||
# FSetConditionsHold <conditions> : <set> ;
|
# FConditionsHold <conditions> : <predicate> ;
|
||||||
# Checks whether the conditions <conditions> are satisfied by the list of
|
# Checks whether the conditions <conditions> are satisfied by the predicate
|
||||||
# elements <set> and returns a respective result (if so: "1", if not: empty
|
# rule <predicate> and returns a respective result (if so: "1", if not:
|
||||||
# list). The conditions are satisfied when <conditions> is not empty and
|
# empty list). The conditions are satisfied when <conditions> is not empty
|
||||||
|
# and
|
||||||
# * none of the negative conditions it contains hold and
|
# * none of the negative conditions it contains hold and
|
||||||
# * if <conditions> contains any positive conditions, at least one one of
|
# * if <conditions> contains any positive conditions, at least one of those
|
||||||
# those holds.
|
# holds.
|
||||||
# A positive condition is an element not starting with a "!". It holds when
|
# A positive condition is an element not starting with a "!". It holds when
|
||||||
# the element is contained in <set>.
|
# the predicate rule <predicate> returns true for the element.
|
||||||
# A negative condition is an element that starts with a "!". It holds when
|
# A negative condition is an element that starts with a "!". It holds when
|
||||||
# the string resulting from removing the leading "!" is not contained in
|
# the predicate rule <predicate> returns true for the string resulting from
|
||||||
# <set>.
|
# removing the leading "!".
|
||||||
#
|
#
|
||||||
# <conditions> - The list of conditions.
|
# <conditions> - The list of conditions.
|
||||||
# <set> - The elements against which the conditions are tested.
|
# <predicate> - The predicate rule invoked to test the elements.
|
||||||
#
|
#
|
||||||
# Examples:
|
# Examples:
|
||||||
# For set { a b c } the following conditions hold:
|
# For a predicate that holds for the elements of the set { a b c } the
|
||||||
|
# following conditions hold:
|
||||||
# { a }, { a d }, { !d }, { !d !e }, { a !d }, { b !e !f }
|
# { a }, { a d }, { !d }, { !d !e }, { a !d }, { b !e !f }
|
||||||
# The following conditions don't hold:
|
# The following conditions don't hold:
|
||||||
# { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d }
|
# { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d }
|
||||||
@@ -131,14 +133,14 @@ rule FSetConditionsHold conditions : set
|
|||||||
{
|
{
|
||||||
hasNegative = 1 ;
|
hasNegative = 1 ;
|
||||||
condition = [ Match "!(.*)" : $(condition) ] ;
|
condition = [ Match "!(.*)" : $(condition) ] ;
|
||||||
if $(condition) in $(set) {
|
if [ $(predicate) $(condition) ] {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case * :
|
case * :
|
||||||
{
|
{
|
||||||
hasPositive = 1 ;
|
hasPositive = 1 ;
|
||||||
if $(condition) in $(set) {
|
if [ $(predicate) $(condition) ] {
|
||||||
positiveMatch = 1 ;
|
positiveMatch = 1 ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+73
-13
@@ -244,8 +244,8 @@ rule BootstrapRepositoryFetchPackage repository : package : fileName
|
|||||||
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] ;
|
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] ;
|
||||||
local configFile
|
local configFile
|
||||||
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_CONFIG_FILE) ] ;
|
= [ on $(repository) return $(HAIKU_REPOSITORY_BUILD_CONFIG_FILE) ] ;
|
||||||
local haikuCrossDevelPackage = [ on $(package)
|
local haikuCrossDevelPackages = [ on $(package)
|
||||||
return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE) ] ;
|
return $(HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES) ] ;
|
||||||
|
|
||||||
local packageFile = <cross-built>$(fileName) ;
|
local packageFile = <cross-built>$(fileName) ;
|
||||||
if [ on $(packageFile) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] {
|
if [ on $(packageFile) return $(HAIKU_REPOSITORY_BUILD_DIRECTORY) ] {
|
||||||
@@ -261,9 +261,9 @@ rule BootstrapRepositoryFetchPackage repository : package : fileName
|
|||||||
# a dependency and is updated always, this package would otherwise be
|
# a dependency and is updated always, this package would otherwise be
|
||||||
# rebuilt always as well.
|
# rebuilt always as well.
|
||||||
|
|
||||||
Depends $(packageFile) : $(haikuCrossDevelPackage) $(configFile) ;
|
Depends $(packageFile) : $(haikuCrossDevelPackages) $(configFile) ;
|
||||||
BootstrapRepositoryFetchPackage1 $(packageFile)
|
BootstrapRepositoryFetchPackage1 $(packageFile)
|
||||||
: $(haikuCrossDevelPackage) ;
|
: $(haikuCrossDevelPackages) ;
|
||||||
|
|
||||||
return $(packageFile) ;
|
return $(packageFile) ;
|
||||||
}
|
}
|
||||||
@@ -278,11 +278,26 @@ actions BootstrapRepositoryFetchPackage1
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# make Haiku cross devel package path absolute
|
# make Haiku cross devel package path absolute
|
||||||
haikuCrossDevelPackage="$(2)"
|
haikuCrossDevelPackage="$(2[1])"
|
||||||
if [[ "$haikuCrossDevelPackage" != /* ]]; then
|
if [[ "$haikuCrossDevelPackage" != /* ]]; then
|
||||||
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
|
haikuCrossDevelPackage="`pwd`/$haikuCrossDevelPackage"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# make secondary Haiku cross devel packages path absolute
|
||||||
|
secondaryCrossDevelPackages=
|
||||||
|
if [ -n "$(2[2-]:J)" ]; then
|
||||||
|
for secondaryCrossDevelPackage in "$(2[2-])" ; do
|
||||||
|
if [[ "$secondaryCrossDevelPackage" != /* ]]; then
|
||||||
|
secondaryCrossDevelPackage="`pwd`/$secondaryCrossDevelPackage"
|
||||||
|
fi
|
||||||
|
if [ -n "$secondaryCrossDevelPackages" ]; then
|
||||||
|
secondaryCrossDevelPackages="secondaryCrossDevelPackages,$secondaryCrossDevelPackage"
|
||||||
|
else
|
||||||
|
secondaryCrossDevelPackages="--secondary-cross-devel-package=$secondaryCrossDevelPackage"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# determine the portName
|
# determine the portName
|
||||||
portName=`basename "$package" | sed 's@-.*@@'`
|
portName=`basename "$package" | sed 's@-.*@@'`
|
||||||
case $portName in
|
case $portName in
|
||||||
@@ -295,7 +310,7 @@ actions BootstrapRepositoryFetchPackage1
|
|||||||
|
|
||||||
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
||||||
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
|
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
|
||||||
$portName
|
"$secondaryCrossDevelPackages" $portName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -321,9 +336,27 @@ EOF
|
|||||||
$(HAIKU_GCC_MACHINE_$(HAIKU_PACKAGING_ARCH))-gcc ]; then
|
$(HAIKU_GCC_MACHINE_$(HAIKU_PACKAGING_ARCH))-gcc ]; then
|
||||||
dir=`dirname $gcc`
|
dir=`dirname $gcc`
|
||||||
dir=`dirname $dir`
|
dir=`dirname $dir`
|
||||||
echo CROSS_TOOLS="$dir" >> $(1)
|
echo CROSS_TOOLS=\"$dir\" >> $(1)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add secondary architectures and cross tools.
|
||||||
|
secondaryArchs="$(HAIKU_PACKAGING_ARCHS[2-]:E=)"
|
||||||
|
if [ -n "$secondaryArchs" ]; then
|
||||||
|
echo SECONDARY_TARGET_ARCHITECTURES=\" >> $(1)
|
||||||
|
for arch in $secondaryArchs; do
|
||||||
|
echo " $arch" >> $(1)
|
||||||
|
done
|
||||||
|
echo \" >> $(1)
|
||||||
|
|
||||||
|
echo SECONDARY_CROSS_TOOLS=\" >> $(1)
|
||||||
|
for gcc in $(HAIKU_CC_$(HAIKU_PACKAGING_ARCHS[2-])); do
|
||||||
|
dir=`dirname $gcc`
|
||||||
|
dir=`dirname $dir`
|
||||||
|
echo " $dir" >> $(1)
|
||||||
|
done
|
||||||
|
echo \" >> $(1)
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -332,6 +365,10 @@ rule BootstrapPackageRepository repository : architecture
|
|||||||
: debugInfoPackages
|
: debugInfoPackages
|
||||||
{
|
{
|
||||||
repository = $(repository:G=repository) ;
|
repository = $(repository:G=repository) ;
|
||||||
|
packagesStage1 = [ FFilterByBuildFeatures $(packagesStage1) ] ;
|
||||||
|
packagesStage2 = [ FFilterByBuildFeatures $(packagesStage2) ] ;
|
||||||
|
sourcePackages = [ FFilterByBuildFeatures $(sourcePackages) ] ;
|
||||||
|
debugInfoPackages = [ FFilterByBuildFeatures $(debugInfoPackages) ] ;
|
||||||
|
|
||||||
SetRepositoryMethod $(repository) : PackageFamily
|
SetRepositoryMethod $(repository) : PackageFamily
|
||||||
: BootstrapRepositoryPackageFamily ;
|
: BootstrapRepositoryPackageFamily ;
|
||||||
@@ -345,15 +382,17 @@ rule BootstrapPackageRepository repository : architecture
|
|||||||
if ! $(stage1PackageTargets) {
|
if ! $(stage1PackageTargets) {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE on $(stage1PackageTargets)
|
local crossDevelPackageSuffixes = $(architecture)
|
||||||
= haiku_cross_devel_sysroot_stage1_$(architecture).hpkg ;
|
$(architecture)_$(HAIKU_PACKAGING_ARCHS[2-]) ;
|
||||||
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage1PackageTargets)
|
||||||
|
= haiku_cross_devel_sysroot_stage1_$(crossDevelPackageSuffixes).hpkg ;
|
||||||
|
|
||||||
# add stage 2 packages
|
# add stage 2 packages
|
||||||
local stage2PackageTargets = [ AddRepositoryPackages $(repository)
|
local stage2PackageTargets = [ AddRepositoryPackages $(repository)
|
||||||
: $(architecture) : $(packagesStage2) : $(sourcePackages)
|
: $(architecture) : $(packagesStage2) : $(sourcePackages)
|
||||||
: $(debugInfoPackages) ] ;
|
: $(debugInfoPackages) ] ;
|
||||||
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGE on $(stage2PackageTargets)
|
HAIKU_REPOSITORY_HAIKU_CROSS_DEVEL_PACKAGES on $(stage2PackageTargets)
|
||||||
= haiku_cross_devel_sysroot_$(architecture).hpkg ;
|
= haiku_cross_devel_sysroot_$(crossDevelPackageSuffixes).hpkg ;
|
||||||
|
|
||||||
# prepare the config file for the HaikuPorts cross build
|
# prepare the config file for the HaikuPorts cross build
|
||||||
local outputDir = [ FDirName
|
local outputDir = [ FDirName
|
||||||
@@ -391,10 +430,29 @@ rule BootstrapPackageRepository repository : architecture
|
|||||||
#pragma mark - Public
|
#pragma mark - Public
|
||||||
|
|
||||||
|
|
||||||
|
rule FSplitPackageName packageName
|
||||||
|
{
|
||||||
|
local splitName = [ Match "(.*)_([^_]*)" : $(packageName) ] ;
|
||||||
|
local knownPackageSuffixes = devel doc source debuginfo ;
|
||||||
|
if $(splitName[2]) && $(splitName[2]) in $(knownPackageSuffixes) {
|
||||||
|
return $(splitName) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $(packageName) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
rule IsPackageAvailable package
|
rule IsPackageAvailable package
|
||||||
{
|
{
|
||||||
|
# for a secondary architecture adjust the package name
|
||||||
|
if $(TARGET_PACKAGING_ARCH) != $(TARGET_PACKAGING_ARCHS[1]) {
|
||||||
|
local splitName = [ FSplitPackageName $(package) ] ;
|
||||||
|
splitName = $(splitName[1]) $(TARGET_PACKAGING_ARCH) $(splitName[2-]) ;
|
||||||
|
package = $(splitName:J=_) ;
|
||||||
|
}
|
||||||
|
|
||||||
if $(package) in $(HAIKU_AVAILABLE_PACKAGES) {
|
if $(package) in $(HAIKU_AVAILABLE_PACKAGES) {
|
||||||
return 1 ;
|
return $(package) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ;
|
return ;
|
||||||
@@ -403,10 +461,12 @@ rule IsPackageAvailable package
|
|||||||
|
|
||||||
rule FetchPackage packageName
|
rule FetchPackage packageName
|
||||||
{
|
{
|
||||||
if ! [ IsPackageAvailable $(packageName) ] {
|
local foundPackageName = [ IsPackageAvailable $(packageName) ] ;
|
||||||
|
if ! $(foundPackageName) {
|
||||||
Exit "DownloadPackage: package" $(packageName) "not available!" ;
|
Exit "DownloadPackage: package" $(packageName) "not available!" ;
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
packageName = $(foundPackageName) ;
|
||||||
|
|
||||||
# TODO: We should support explicitly specified versions (or partial/minimum
|
# TODO: We should support explicitly specified versions (or partial/minimum
|
||||||
# versions like gcc-2 or gcc-4).
|
# versions like gcc-2 or gcc-4).
|
||||||
|
|||||||
@@ -27,6 +27,13 @@ BootstrapPackageRepository HaikuPortsCross
|
|||||||
texinfo_bootstrap-4.13a-1
|
texinfo_bootstrap-4.13a-1
|
||||||
zlib_bootstrap-1.2.8-2
|
zlib_bootstrap-1.2.8-2
|
||||||
zlib_bootstrap_devel-1.2.8-2
|
zlib_bootstrap_devel-1.2.8-2
|
||||||
|
|
||||||
|
secondary_x86 @{
|
||||||
|
icu_bootstrap_x86-4.8.1.1-1
|
||||||
|
icu_bootstrap_x86_devel-4.8.1.1-1
|
||||||
|
zlib_bootstrap_x86-1.2.8-2
|
||||||
|
zlib_bootstrap_x86_devel-1.2.8-2
|
||||||
|
}@ # secondary_x86
|
||||||
:
|
:
|
||||||
# repository architecture packages (stage 2)
|
# repository architecture packages (stage 2)
|
||||||
libsolv_bootstrap-0.3.0_haiku_2013_06_16-1
|
libsolv_bootstrap-0.3.0_haiku_2013_06_16-1
|
||||||
|
|||||||
Reference in New Issue
Block a user