2013-05-20 01:30:23 +04:00
|
|
|
# This package is like the HaikuDevel package, but it is meant for cross
|
|
|
|
# development, i.e. it assumes that a specific cross compiler is installed
|
|
|
|
# on the Haiku system where this package is being used.
|
|
|
|
# The main use of this package is to provide HaikuPorter with a development
|
|
|
|
# environment for a cross-build Haiku platform.
|
|
|
|
|
2013-08-03 07:26:25 +04:00
|
|
|
local primaryArchitecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
|
2013-08-01 10:51:16 +04:00
|
|
|
local architecture = $(TARGET_PACKAGING_ARCH) ;
|
|
|
|
local isPrimaryArchitecture = [ MultiArchIfPrimary 1 : ] ;
|
|
|
|
|
2013-08-03 07:26:25 +04:00
|
|
|
local packageNameSuffix = $(primaryArchitecture) ;
|
|
|
|
local architectureSubDir ;
|
|
|
|
if ! $(isPrimaryArchitecture) {
|
|
|
|
packageNameSuffix = $(primaryArchitecture)_$(architecture) ;
|
|
|
|
architectureSubDir = $(architecture) ;
|
|
|
|
}
|
2013-08-01 10:51:16 +04:00
|
|
|
|
2013-07-21 06:10:48 +04:00
|
|
|
local additionalLibraries_stage1 ;
|
2013-08-01 10:51:16 +04:00
|
|
|
local additionalLibraries
|
|
|
|
= [ MultiArchDefaultGristFiles libbe.so libnetwork.so libpackage.so ] ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
local stage ;
|
2014-08-12 00:28:44 +04:00
|
|
|
for stage in _stage0 _stage1 "" {
|
2013-07-21 06:10:48 +04:00
|
|
|
# first create the actual cross development package
|
|
|
|
|
|
|
|
local haikuCrossDevelSysrootPackage
|
2013-08-03 07:26:25 +04:00
|
|
|
= haiku_cross_devel_sysroot$(stage)_$(packageNameSuffix).hpkg ;
|
2013-07-21 06:10:48 +04:00
|
|
|
HaikuPackage $(haikuCrossDevelSysrootPackage) ;
|
|
|
|
|
2013-08-03 07:26:25 +04:00
|
|
|
local developCrossLibDirTokens = develop lib $(architectureSubDir) ;
|
2013-07-21 06:10:48 +04:00
|
|
|
|
2014-08-12 00:28:44 +04:00
|
|
|
if $(stage) = _stage0 {
|
|
|
|
# glue code
|
|
|
|
AddFilesToPackage $(developCrossLibDirTokens) :
|
|
|
|
<bootstrap!src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crti.o
|
|
|
|
<bootstrap!src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crtn.o
|
|
|
|
<bootstrap!src!system!glue!$(architecture)>init_term_dyn.o
|
|
|
|
<bootstrap!src!system!glue!$(architecture)>start_dyn.o
|
|
|
|
<bootstrap!src!system!glue!$(architecture)>haiku_version_glue.o
|
|
|
|
;
|
|
|
|
|
|
|
|
# libraries
|
|
|
|
AddLibrariesToPackage $(developCrossLibDirTokens) :
|
|
|
|
[ MultiArchDefaultGristFiles libroot.so : stubbed ]
|
|
|
|
;
|
|
|
|
} else {
|
|
|
|
# glue code
|
|
|
|
AddFilesToPackage $(developCrossLibDirTokens) :
|
|
|
|
<src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crti.o
|
|
|
|
<src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crtn.o
|
|
|
|
<src!system!glue!$(architecture)>init_term_dyn.o
|
|
|
|
<src!system!glue!$(architecture)>start_dyn.o
|
|
|
|
<src!system!glue!$(architecture)>haiku_version_glue.o
|
|
|
|
;
|
|
|
|
|
|
|
|
# kernel
|
|
|
|
if $(isPrimaryArchitecture) {
|
|
|
|
AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# libraries
|
|
|
|
AddLibrariesToPackage $(developCrossLibDirTokens) :
|
|
|
|
[ MultiArchDefaultGristFiles libbsd.so ]
|
|
|
|
[ MultiArchDefaultGristFiles libroot.so : revisioned ]
|
|
|
|
[ MultiArchDefaultGristFiles libnetwork.so ]
|
|
|
|
[ TargetLibstdc++ ]
|
|
|
|
[ TargetLibsupc++ ]
|
|
|
|
$(additionalLibraries$(stage))
|
|
|
|
;
|
|
|
|
|
|
|
|
# static libraries
|
|
|
|
AddFilesToPackage $(developCrossLibDirTokens)
|
|
|
|
: <$(architecture)>liblocalestub.a ;
|
|
|
|
|
|
|
|
# the POSIX error code mapper library
|
|
|
|
AddFilesToPackage $(developCrossLibDirTokens)
|
|
|
|
: [ MultiArchDefaultGristFiles libposix_error_mapper.a ] ;
|
2013-08-01 10:51:16 +04:00
|
|
|
}
|
2013-07-21 06:10:48 +04:00
|
|
|
|
|
|
|
# headers
|
|
|
|
local developCrossHeadersDirTokens = develop headers ;
|
|
|
|
local headerDir ;
|
|
|
|
for headerDir in config glibc os posix {
|
|
|
|
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
|
|
|
|
: [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ;
|
|
|
|
}
|
|
|
|
|
|
|
|
# BSD and GNU compatibility headers
|
|
|
|
for headerDir in bsd gnu {
|
|
|
|
CopyDirectoryToPackage $(developCrossHeadersDirTokens)
|
|
|
|
: [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ;
|
|
|
|
}
|
|
|
|
|
2014-08-12 00:28:44 +04:00
|
|
|
if $(stage) != _stage0 {
|
|
|
|
# cpp headers
|
2020-10-07 06:46:18 +03:00
|
|
|
if $(HAIKU_CC_IS_LEGACY_GCC_$(architecture)) = 1 {
|
2014-08-12 00:28:44 +04:00
|
|
|
# GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
|
|
|
|
CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++
|
|
|
|
: [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
|
|
|
|
}
|
2013-07-21 06:10:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
BuildHaikuPackage $(haikuCrossDevelSysrootPackage)
|
|
|
|
: haiku_cross_devel_sysroot ;
|
|
|
|
|
|
|
|
# Now create a wrapper package which just contains the actual cross
|
|
|
|
# development package. This wrapper package can safely be installed into the
|
|
|
|
# system hierarchy of the target system, from where haikuporter will fetch
|
|
|
|
# it when needed.
|
|
|
|
|
2013-08-03 07:26:25 +04:00
|
|
|
local haikuCrossDevelPackage
|
|
|
|
= haiku_cross_devel$(stage)_$(packageNameSuffix).hpkg ;
|
2013-07-21 06:10:48 +04:00
|
|
|
HaikuPackage $(haikuCrossDevelPackage) ;
|
|
|
|
|
|
|
|
# add the wrapped package
|
|
|
|
local developCrossDirTokens = develop cross ;
|
|
|
|
AddFilesToPackage $(developCrossDirTokens)
|
|
|
|
: $(haikuCrossDevelSysrootPackage) ;
|
|
|
|
|
|
|
|
BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ;
|
2013-05-20 01:30:23 +04:00
|
|
|
}
|