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. 6 7local primaryArchitecture = $(HAIKU_PACKAGING_ARCHS[1]) ; 8local architecture = $(TARGET_PACKAGING_ARCH) ; 9local isPrimaryArchitecture = [ MultiArchIfPrimary 1 : ] ; 10 11local packageNameSuffix = $(primaryArchitecture) ; 12local architectureSubDir ; 13if ! $(isPrimaryArchitecture) { 14 packageNameSuffix = $(primaryArchitecture)_$(architecture) ; 15 architectureSubDir = $(architecture) ; 16} 17 18local additionalLibraries_stage1 ; 19local additionalLibraries 20 = [ MultiArchDefaultGristFiles libbe.so libnetwork.so libpackage.so ] ; 21 22local stage ; 23for stage in _stage1 "" { 24 # first create the actual cross development package 25 26 local haikuCrossDevelSysrootPackage 27 = haiku_cross_devel_sysroot$(stage)_$(packageNameSuffix).hpkg ; 28 HaikuPackage $(haikuCrossDevelSysrootPackage) ; 29 30 local developCrossLibDirTokens = develop lib $(architectureSubDir) ; 31 32 # glue code 33 AddFilesToPackage $(developCrossLibDirTokens) : 34 <src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crti.o 35 <src!system!glue!arch!$(TARGET_ARCH)!$(architecture)>crtn.o 36 <src!system!glue!$(architecture)>init_term_dyn.o 37 <src!system!glue!$(architecture)>start_dyn.o 38 <src!system!glue!$(architecture)>haiku_version_glue.o 39 ; 40 41 # kernel 42 if $(isPrimaryArchitecture) { 43 AddFilesToPackage $(developCrossLibDirTokens) : kernel.so : _KERNEL_ ; 44 } 45 46 # libraries 47 AddLibrariesToPackage $(developCrossLibDirTokens) : 48 [ MultiArchDefaultGristFiles libbsd.so ] 49 [ MultiArchDefaultGristFiles libroot.so : revisioned ] 50 [ MultiArchDefaultGristFiles libnetwork.so ] 51 $(HAIKU_SHARED_LIBSTDC++_$(architecture)) 52 $(HAIKU_SHARED_LIBSUPC++_$(architecture)) 53 $(additionalLibraries$(stage)) 54 ; 55 56 # static libraries 57 AddFilesToPackage $(developCrossLibDirTokens) 58 : <$(architecture)>liblocalestub.a ; 59 60 # the POSIX error code mapper library 61 AddFilesToPackage $(developCrossLibDirTokens) 62 : [ MultiArchDefaultGristFiles libposix_error_mapper.a ] ; 63 64 # headers 65 local developCrossHeadersDirTokens = develop headers ; 66 local headerDir ; 67 for headerDir in config glibc os posix { 68 CopyDirectoryToPackage $(developCrossHeadersDirTokens) 69 : [ FDirName $(HAIKU_TOP) headers $(headerDir) ] ; 70 } 71 72 # BSD and GNU compatibility headers 73 for headerDir in bsd gnu { 74 CopyDirectoryToPackage $(developCrossHeadersDirTokens) 75 : [ FDirName $(HAIKU_TOP) headers compatibility $(headerDir) ] ; 76 } 77 78 # cpp headers 79 if $(HAIKU_GCC_VERSION_$(architecture)[1]) = 2 { 80 # GCC 2 only -- for GCC 4 they come with the DevelopmentBase package 81 CopyDirectoryToPackage $(developCrossHeadersDirTokens) c++ 82 : [ FDirName $(HAIKU_TOP) headers cpp ] : 2.95.3 ; 83 } 84 85 BuildHaikuPackage $(haikuCrossDevelSysrootPackage) 86 : haiku_cross_devel_sysroot ; 87 88 # Now create a wrapper package which just contains the actual cross 89 # development package. This wrapper package can safely be installed into the 90 # system hierarchy of the target system, from where haikuporter will fetch 91 # it when needed. 92 93 local haikuCrossDevelPackage 94 = haiku_cross_devel$(stage)_$(packageNameSuffix).hpkg ; 95 HaikuPackage $(haikuCrossDevelPackage) ; 96 97 # add the wrapped package 98 local developCrossDirTokens = develop cross ; 99 AddFilesToPackage $(developCrossDirTokens) 100 : $(haikuCrossDevelSysrootPackage) ; 101 102 BuildHaikuPackage $(haikuCrossDevelPackage) : haiku_cross_devel ; 103} 104