build/jam: Inline HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR where possible.

The "exec" tool can only handle one command with environs set at
the beginning of the line, so now we set the ADD_BUILD_COMPAT...
in this format. This also seems to be a general performance
improvement to builds using real shells, too.

Change-Id: If4b3117651b5475039d5e8116cd3de398582290a
This commit is contained in:
Augustin Cavalier 2019-08-30 17:11:50 -04:00
parent 12eb0e5d89
commit 128781e740
16 changed files with 51 additions and 49 deletions

View File

@ -39,7 +39,7 @@ actions CreateAttributeMetaFile
actions AddFileDataAttribute1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -f $(2[3]) `cat $(2[2])` $(1)
}
@ -75,7 +75,7 @@ rule AddStringDataResource
actions together AddStringDataResource1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -o "$(1)" $(RESOURCE_STRINGS)
}
@ -115,7 +115,7 @@ rule AddFileDataResource
actions AddFileDataResource1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -o "$(1)" -a "$(RESOURCE_ID)" "$(2[2])" ;
}
@ -131,8 +131,8 @@ rule XRes
actions XRes1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -o "$(1)" "$(2[2-])" ;
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -o "$(1)" "$(2[2-])"
}
rule SetVersion
@ -145,8 +145,8 @@ rule SetVersion
actions SetVersion1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) "$(1)" -system $(HAIKU_BUILD_VERSION) -short "$(HAIKU_BUILD_DESCRIPTION)" ;
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) "$(1)" -system $(HAIKU_BUILD_VERSION) -short "$(HAIKU_BUILD_DESCRIPTION)"
}
rule SetType target : type
@ -163,8 +163,8 @@ rule SetType target : type
actions SetType1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -t $(TARGET_MIME_TYPE) "$(1)" ;
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -t $(TARGET_MIME_TYPE) "$(1)"
}
rule MimeSet target
@ -178,7 +178,7 @@ rule MimeSet target
actions MimeSet1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -f --mimedb "$(2[2])" "$(1)"
}
@ -204,7 +204,7 @@ rule CreateAppMimeDBEntries target
actions CreateAppMimeDBEntries1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
appMimeDB="$(1)"
$(RM) -rf "$appMimeDB"
@ -264,7 +264,7 @@ rule ResComp
# considered linker scripts, and thus we can use preprocessor features.
actions ResComp1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
cat "$(2[2-])" | $(CC) $(CCFLAGS) -E $(CCDEFS) $(HDRS) - \
| egrep -v '^#' | $(2[1]) $(RCHDRS) --auto-names -o "$(1)" -
}
@ -305,7 +305,7 @@ rule ResAttr attributeFile : _resourceFiles : deleteAttributeFile
actions ResAttr1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ \\"$(deleteAttributeFile1)\\" = "true" ]; then
$(RM) $(1)
fi

View File

@ -388,7 +388,7 @@ if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
}
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
= "export \"LIBRARY_PATH=$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)\"" ;
= "LIBRARY_PATH=\"$LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)\"" ;
HOST_PTHREAD_LINKFLAGS = ;
HOST_LIBRARY_NAME_MAP_input_server = /system/servers/input_server ;
HOST_DEFINES += __STDC_FORMAT_MACROS __STDC_LIMIT_MACROS ;
@ -402,13 +402,13 @@ if $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
HOST_LIBSTDC++ = stdc++ ;
if $(HOST_PLATFORM) = mingw {
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
= "export PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
= "PATH=$PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)" ;
} else if $(HOST_PLATFORM) = darwin {
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
= "export \"DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)\"" ;
= "DYLD_LIBRARY_PATH=\"$DYLD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)\"" ;
} else {
HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR
= "export \"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)\"" ;
= "LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:$(HOST_BUILD_COMPATIBILITY_LIB_DIR)\"" ;
}
HOST_PTHREAD_LINKFLAGS = -pthread ;
@ -450,7 +450,7 @@ if $(HAIKU_HOST_USE_XATTR) = 1 {
# which invokes a build tool. If the build tool hasn't been built yet,
# the normal "rm" is used and the attributes are leaked (likely there
# aren't any yet).
RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ";"
RM = $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
[ FDirName $(HAIKU_TOP) build scripts rm_attrs ]
[ FDirName $(HAIKU_OBJECT_DIR) $(HOST_PLATFORM) $(HOST_ARCH) release
tools rm_attrs ] -f ;

View File

@ -10,7 +10,7 @@ rule Copy
actions Copy1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
"$(2[1])" -d "$(2[2-])" "$(1)"
}
@ -295,7 +295,7 @@ actions ExtractTarArchive1
actions ExtractHPKGArchive1
{
mkdir -p "$(1)"
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) extract -C "$(1)" "$(2[2])"
}
@ -355,7 +355,7 @@ rule CopySetHaikuRevision target : source
actions CopySetHaikuRevision1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) --data $(2[3]) $(1) || exit 1
@ -422,7 +422,7 @@ rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable
actions DataFileToSourceFile1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) $(DATA_VARIABLE) $(SIZE_VARIABLE) $(2[2]) $(1)
}
@ -594,7 +594,7 @@ rule StripFile target : source
actions StripFile1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
"$(STRIP)" -o "$(1)" "$(2[1])"
"$(2[2])" -o "$(1)" "$(2[1])"
"$(2[3])" "$(2[1])" "$(1)"

View File

@ -97,7 +97,7 @@ rule KernelSo target : source
actions KernelSo1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) --data $(2[2]) $(1) &&
$(HAIKU_ELFEDIT_$(TARGET_PACKAGING_ARCH)) --output-type dyn $(1)

View File

@ -77,7 +77,7 @@ rule ExtractCatalogEntries target : sources : signature : regexp
actions ExtractCatalogEntries1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(CC) -E $(CCDEFS) -DB_COLLECTING_CATKEYS $(HDRS) "$(2[2-])" > "$(1)".pre
$(2[1]) $(HAIKU_CATALOG_REGEXP) -s $(HAIKU_CATALOG_SIGNATURE) \
-w -o "$(1)" "$(1)".pre
@ -86,7 +86,7 @@ actions ExtractCatalogEntries1
actions ExtractCatalogEntries2
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(CC) -E $(CCDEFS) -DB_COLLECTING_CATKEYS $(HDRS) "$(2[2-])" > "$(1)".pre \
|| true
$(2[1]) $(HAIKU_CATALOG_REGEXP) -s $(HAIKU_CATALOG_SIGNATURE) \
@ -113,7 +113,7 @@ rule LinkApplicationCatalog target : sources : signature : language
actions LinkApplicationCatalog1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) "$(2[2-])" -l $(HAIKU_CATALOG_LANGUAGE) \
-s $(HAIKU_CATALOG_SIGNATURE) -o "$(1)"
}
@ -198,6 +198,6 @@ rule AddCatalogEntryAttribute target
actions AddCatalogEntryAttribute1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
"$(2)" -t string "SYS:NAME" "$(CATALOG_ENTRY)" "$(1)"
}

View File

@ -266,7 +266,7 @@ actions RunCommandLine1 {
target=${target}X
eval "${target}=${t}"
done
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
"$(COMMAND_LINE)"
}

View File

@ -75,7 +75,7 @@ rule PreprocessPackageInfo source : directory : architecture
actions UpdatePackageInfoRequires
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
"$(2[1])" "$(1)" "$(2[2])"
}
@ -183,7 +183,7 @@ rule BuildHaikuPackage package : packageInfo
AddVariableToScript $(script) : outputDir : $(HAIKU_OUTPUT_DIR) ;
AddVariableToScript $(script) : tmpDir : $(tempDir) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddVariableToScript $(script) : compressionLevel
: [ on $(package) return $(HAIKU_PACKAGE_COMPRESSION_LEVEL) ] ;
AddVariableToScript $(script) : updateOnly

View File

@ -256,7 +256,7 @@ actions RepositoryConfig1
if [ -n "$(2[3]:E)" ]; then
version=`cat "$(2[3]:E)"`
fi
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) $(2[2]) $(1)
}
@ -272,7 +272,7 @@ rule RepositoryCache repoCache : repoInfo : packageFiles
actions RepositoryCache1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) create -q $(2[2-])
mv $(1:B=repo) $(1)
}
@ -362,7 +362,7 @@ actions BootstrapRepositoryFetchPackage1
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ -n "$secondaryCrossDevelPackages" ]; then
$(HOST_HAIKU_PORTER) -j$(HAIKU_PORTER_CONCURRENT_JOBS) \
--all-dependencies $(HAIKU_PORTER_EXTRA_OPTIONS) \
@ -665,7 +665,7 @@ actions BuildHaikuPortsSourcePackageDirectory1
cd $(HAIKU_REPOSITORY_BUILD_DIRECTORY)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
if [ -n "$secondaryCrossDevelPackages" ]; then
$(HOST_HAIKU_PORTER) --cross-devel-package "$haikuCrossDevelPackage" \
"$secondaryCrossDevelPackages" \
@ -763,7 +763,7 @@ rule HaikuRepository repository : repoInfoTemplate : packages
local script = $(initVariablesScript) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddVariableToScript $(script) : sha256 : $(HOST_SHA256) ;
AddVariableToScript $(script) : sedExtendedRegex
: $(HOST_EXTENDED_REGEX_SED) ;

View File

@ -136,7 +136,7 @@ Always $(script) ;
AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddTargetVariableToScript $(script) : <build>copyattr ;
# create the other scripts

View File

@ -20,7 +20,7 @@ AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
AddVariableToScript $(script) : isCD : 1 ;
AddVariableToScript $(script) : cdLabel : $(HAIKU_CD_LABEL) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddTargetVariableToScript $(script) : <build>addattr ;
AddTargetVariableToScript $(script) : <build>copyattr ;
AddTargetVariableToScript $(script) : <build>rc ;

View File

@ -119,7 +119,7 @@ Always $(script) ;
AddVariableToScript $(script) : tmpDir : $(HAIKU_TMP_DIR) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddTargetVariableToScript $(script) : <build>copyattr ;
# create the other scripts

View File

@ -111,7 +111,7 @@ AddVariableToScript $(script) : installDir : $(HAIKU_INSTALL_DIR) ;
AddVariableToScript $(script) : imageSize : $(HAIKU_IMAGE_SIZE) ;
AddVariableToScript $(script) : imageLabel : $(HAIKU_IMAGE_LABEL) ;
AddVariableToScript $(script) : addBuildCompatibilityLibDir
: $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) ;
: "export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)" ;
AddVariableToScript $(script) : dontClearImage : $(HAIKU_DONT_CLEAR_IMAGE) ;
AddVariableToScript $(script) : updateOnly : [ IsUpdateHaikuImageOnly ] ;
AddTargetVariableToScript $(script) : <build>addattr ;

View File

@ -19,8 +19,8 @@ rule MkKeymapComp
actions MkKeymapComp1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -o "$(1)" -c "$(2[2-])" ;
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -o "$(1)" -c "$(2[2-])"
}

View File

@ -46,7 +46,7 @@ rule BuildMimeDB superTypes
actions BuildMimeDBSuperTypes
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
# remove and re-create the directory
baseDirectory="$(1)"
@ -66,7 +66,7 @@ actions BuildMimeDBSuperTypes
actions BuildMimeDBSubTypes
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
export $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
resattr="$(2[1])"
superType=`basename "$(2[2])" .super`

View File

@ -1,6 +1,7 @@
SubDir HAIKU_TOP src servers input ;
rule MkKeymapHeader {
rule MkKeymapHeader
{
local binary = $(1) ;
local source = $(2) ;
@ -12,9 +13,10 @@ rule MkKeymapHeader {
LocalClean clean : $(binary) ;
}
actions MkKeymapHeader1 {
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) -o "$(1)" -h "$(2[2-])" ;
actions MkKeymapHeader1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(2[1]) -o "$(1)" -h "$(2[2-])"
}
MkKeymapHeader [ FGristFiles SystemKeymap.h ] : US-International.keymap ;

View File

@ -34,7 +34,7 @@ rule BuildAoutLoader {
actions BuildAoutLoader bind ELF2AOUT {
rm -f $(1)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) \
$(ELF2AOUT) -o $(1) $(2)
}