1 # This package is like the HaikuDevel package, but it is meant for cross
2 # development, i.e. it assumes that a specific cross compiler is installed
3 # on the Haiku system where this package is being used.
4 # The main use of this package is to provide HaikuPorter with a development
5 # environment for a cross-build Haiku platform.
7 local primaryArchitecture = $(HAIKU_PACKAGING_ARCHS[1]) ;
8 local architecture = $(TARGET_PACKAGING_ARCH) ;
9 local isPrimaryArchitecture = [ MultiArchIfPrimary 1 : ] ;
11 local packageNameSuffix = $(primaryArchitecture) ;
12 local architectureSubDir ;
13 if ! $(isPrimaryArchitecture) {
14 packageNameSuffix = $(primaryArchitecture)_$(architecture) ;
15 architectureSubDir = $(architecture) ;
18 local additionalLibraries_stage1 ;
19 local additionalLibraries
20 = [ MultiArchDefaultGristFiles libbe.so libnetwork.so libpackage.so ] ;
23 for stage in _stage0 _stage1 "" {
24 # first create the actual cross development package
26 local haikuCrossDevelSysrootPackage
27 = haiku_cross_devel_sysroot$(stage)_$(packageNameSuffix).hpkg ;
28 HaikuPackage $(haikuCrossDevelSysrootPackage) ;
30 local developCrossLibDirTokens = develop lib $(architectureSubDir) ;
32 if $(stage) = _stage0 {
34 AddFilesToPackage $(developCrossLibDirTokens) :
35 <bootstrap!src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crti.o
36 <bootstrap!src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crtn.o
37 <bootstrap!src!system!glue!$(architecture)>init_term_dyn.o
38 <bootstrap!src!system!glue!$(architecture)>start_dyn.o
39 <bootstrap!src!system!glue!$(architecture)>haiku_version_glue.o
43 AddLibrariesToPackage $(developCrossLibDirTokens) :
44 [ MultiArchDefaultGristFiles libroot.so : stubbed ]
48 AddFilesToPackage $(developCrossLibDirTokens) :
49 <src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crti.o
50 <src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crtn.o
51 <src!system!glue!$(architecture)>init_term_dyn.o
52 <src!system!glue!$(architecture)>start_dyn.o
53 <src!system!glue!$(architecture)>haiku_version_glue.o
57 if $(isPrimaryArchitecture) {
58 AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ;
62 AddLibrariesToPackage $(developCrossLibDirTokens) :
63 [ MultiArchDefaultGristFiles libbsd.so ]
64 [ MultiArchDefaultGristFiles libroot.so : revisioned ]
65 [ MultiArchDefaultGristFiles libnetwork.so ]
68 $(additionalLibraries$(stage))
72 AddFilesToPackage $(developCrossLibDirTokens)
73 : <$(architecture)>liblocalestub.a ;
75 # the POSIX error code mapper library
76 AddFilesToPackage $(developCrossLibDirTokens)
77 : [ MultiArchDefaultGristFiles libposix_error_mapper.a ] ;
81 local developCrossHeadersDirTokens = develop headers ;
83 for headerDir in config glibc os posix {
84 CopyDirectoryToPackage $(developCrossHeadersDirTokens)
85 : [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ;
88 # BSD and GNU compatibility headers
89 for headerDir in bsd gnu {
90 CopyDirectoryToPackage $(developCrossHeadersDirTokens)
91 : [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ;
94 if $(stage) != _stage0 {
96 if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 {
97 # GCC 2 only -- for GCC 4 they come with the DevelopmentBase package
98 CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++
99 : [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ;
103 BuildHaikuPackage $(haikuCrossDevelSysrootPackage)
104 : haiku_cross_devel_sysroot ;
106 # Now create a wrapper package which just contains the actual cross
107 # development package. This wrapper package can safely be installed into the
108 # system hierarchy of the target system, from where haikuporter will fetch
111 local haikuCrossDevelPackage
112 = haiku_cross_devel$(stage)_$(packageNameSuffix).hpkg ;
113 HaikuPackage $(haikuCrossDevelPackage) ;
115 # add the wrapped package
116 local developCrossDirTokens = develop cross ;
117 AddFilesToPackage $(developCrossDirTokens)
118 : $(haikuCrossDevelSysrootPackage) ;
120 BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ;