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:
Ingo Weinhold
2013-08-05 07:09:45 +02:00
parent 7bd562abc9
commit 93cfb72270
6 changed files with 210 additions and 97 deletions
+16 -14
View File
@@ -97,26 +97,28 @@ rule FSplitPath
}
rule FSetConditionsHold conditions : set
rule FConditionsHold conditions : predicate
{
# FSetConditionsHold <conditions> : <set> ;
# Checks whether the conditions <conditions> are satisfied by the list of
# elements <set> and returns a respective result (if so: "1", if not: empty
# list). The conditions are satisfied when <conditions> is not empty and
# FConditionsHold <conditions> : <predicate> ;
# Checks whether the conditions <conditions> are satisfied by the predicate
# rule <predicate> and returns a respective result (if so: "1", if not:
# empty list). The conditions are satisfied when <conditions> is not empty
# and
# * none of the negative conditions it contains hold and
# * if <conditions> contains any positive conditions, at least one one of
# those holds.
# * if <conditions> contains any positive conditions, at least one of those
# holds.
# 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
# the string resulting from removing the leading "!" is not contained in
# <set>.
# the predicate rule <predicate> returns true for the string resulting from
# removing the leading "!".
#
# <conditions> - The list of conditions.
# <set> - The elements against which the conditions are tested.
# <predicate> - The predicate rule invoked to test the elements.
#
# 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 }
# The following conditions don't hold:
# { }, { d }, { d e }, { !a }, { !a b }, { !d e } { a b !c !d }
@@ -131,14 +133,14 @@ rule FSetConditionsHold conditions : set
{
hasNegative = 1 ;
condition = [ Match "!(.*)" : $(condition) ] ;
if $(condition) in $(set) {
if [ $(predicate) $(condition) ] {
return ;
}
}
case * :
{
hasPositive = 1 ;
if $(condition) in $(set) {
if [ $(predicate) $(condition) ] {
positiveMatch = 1 ;
}
}