boot: Move boot_zlib build out of tarfs directory.

It is also used by packagefs. Another library is coming in the next commit.
This commit is contained in:
Augustin Cavalier
2021-10-19 17:45:19 -04:00
parent dedd2be949
commit 7bd549882a
3 changed files with 38 additions and 29 deletions
+1
View File
@@ -401,5 +401,6 @@ for platform in [ MultiBootSubDirSetup ] {
}
SubInclude HAIKU_TOP src system boot arch $(TARGET_KERNEL_ARCH_DIR) ;
SubInclude HAIKU_TOP src system boot libs ;
SubInclude HAIKU_TOP src system boot loader ;
SubInclude HAIKU_TOP src system boot platform ;
+34
View File
@@ -0,0 +1,34 @@
SubDir HAIKU_TOP src system boot libs ;
local zlibSourceDirectory = [ BuildFeatureAttribute zlib : sources : path ] ;
UseHeaders $(zlibSourceDirectory) ;
UseHeaders $(zlibSourceDirectory) : true ;
DEFINES += _BOOT_MODE ;
local zlibSources =
adler32.c
crc32.c
inffast.c
inflate.c
inftrees.c
uncompr.c
zutil.c
;
local platform ;
for platform in [ MultiBootSubDirSetup ] {
on $(platform) {
# zlib
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ;
Depends [ FGristFiles $(zlibSources) ]
: [ BuildFeatureAttribute zlib : sources ] ;
BootStaticLibrary [ MultiBootGristFiles boot_zlib ] :
$(zlibSources)
;
}
}
@@ -3,47 +3,21 @@ SubDir HAIKU_TOP src system boot loader file_systems tarfs ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders kernel shared storage ;
local zlibSourceDirectory = [ BuildFeatureAttribute zlib : sources : path ] ;
UseHeaders $(zlibSourceDirectory) ;
UseHeaders $(zlibSourceDirectory) : true ;
UseBuildFeatureHeaders zlib ;
local defines = [ FDefines _BOOT_MODE ] ;
SubDirCcFlags $(defines) ;
SubDirC++Flags -fno-rtti $(defines) ;
local zlibSources =
adler32.c
crc32.c
inffast.c
inflate.c
inftrees.c
uncompr.c
zutil.c
;
local platform ;
for platform in [ MultiBootSubDirSetup ] {
on $(platform) {
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
LOCATE on [ FGristFiles $(zlibSources) ] = $(zlibSourceDirectory) ;
Depends [ FGristFiles $(zlibSources) ]
: [ BuildFeatureAttribute zlib : sources ] ;
BootStaticLibrary [ MultiBootGristFiles boot_zlib ] :
$(zlibSources)
;
Includes [ FGristFiles tarfs.cpp ] : [ BuildFeatureAttribute zlib : sources ] ;
# Strictly speaking it should be "headers", but the sources contain the
# headers as well and we have already added the sources directory to the
# header search path for the subdirectory. Should building boot_zlib be
# moved to its own directory, this should better be changes as well.
BootStaticLibrary [ MultiBootGristFiles boot_tarfs ] :
tarfs.cpp
;
Includes [ FGristFiles tarfs.cpp ] : [ BuildFeatureAttribute zlib : headers ] ;
}
}