xref: /haiku/Jamfile (revision a81d165008c82d24e8939daaf8177e29550ec764)
1SubDir HAIKU_TOP ;
2
3# Prepare the optional build features before parsing the Jamfile tree.
4local architectureObject ;
5for architectureObject in [ MultiArchSubDirSetup ] {
6	on $(architectureObject) {
7		include [ FDirName $(HAIKU_BUILD_RULES_DIR) BuildFeatures ] ;
8
9		# Let the target platform depend on the external header directories such
10		# that those will be unpacked before anything is built for the target
11		# platform.
12		Depends $(TARGET_PLATFORM) : [
13			BuildFeatureAttribute gcc_syslibs_devel : c++-headers
14		] [
15			BuildFeatureAttribute gcc_syslibs_devel : gcc-headers
16		] ;
17	}
18}
19
20# Include required packages:
21# primary architecture
22AddHaikuImageSystemPackages [ FFilterByBuildFeatures
23	bash bc freetype libsolv zlib
24
25	!gcc2 @{ coreutils icu66 }@
26	gcc2 @{ coreutils_x86 icu icu66_x86@secondary_x86 }@
27	regular_image @{
28		bzip2 diffutils expat ffmpeg findutils glu gutenprint8 gzip
29		lame less libedit libicns
30		mawk mesa mesa_devel mesa_swpipe@!gcc2 mesa_swrast@gcc2
31		netcat
32		sed sharutils
33		tcpdump unzip wget which zip
34
35		!gcc2 @{ grep tar zstd }@
36		gcc2 @{ grep_x86@secondary_x86 tar_x86@secondary_x86 }@
37	}@
38] ;
39AddHaikuImageSourcePackages [ FFilterByBuildFeatures
40	bash bc
41
42	!gcc2 @{ coreutils }@
43	gcc2 @{ coreutils_x86 }@
44
45	regular_image @{
46		expat ffmpeg findutils grep gutenprint8 gzip
47		lame less libicns mawk
48		sed sharutils
49		tar wget which
50	}@
51] ;
52if $(HAIKU_PACKAGING_ARCHS[1]) != x86_gcc2 {
53	AddHaikuImageSystemPackages [ FFilterByBuildFeatures gcc_syslibs ] ;
54}
55
56if $(HAIKU_PACKAGING_ARCHS[2]) {
57	# secondary architectures
58	local architectureObject ;
59	for architectureObject
60			in [ MultiArchSubDirSetup $(HAIKU_PACKAGING_ARCHS[2-]) ] {
61		on $(architectureObject) {
62			AddHaikuImageSystemPackages [ FFilterByBuildFeatures
63				freetype icu libsolv zlib
64
65				regular_image @{
66					ffmpeg glu jasper jpeg libavif libicns libpng16 libwebp mesa
67				}@
68			] ;
69			if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
70				AddHaikuImageSystemPackages [ FFilterByBuildFeatures gcc_syslibs
71					mesa_swpipe ] ;
72			}
73		}
74	}
75}
76
77# If enabled, make sure that OpenSSL is added to the image.
78if [ FIsBuildFeatureEnabled openssl ] {
79	AddHaikuImageSystemPackages openssl ;
80}
81
82# add additionally requested packages
83AddHaikuImageSystemPackages $(HAIKU_IMAGE_ADDITIONAL_PACKAGES) ;
84
85# Optionally we allow not to include the "src" subdirectory.
86if $(HAIKU_DONT_INCLUDE_SRC) {
87	# Don't include "src", but at least include the stuff needed for the
88	# build.
89	SubInclude HAIKU_TOP src build ;
90	SubInclude HAIKU_TOP src tools ;
91} else {
92	SubInclude HAIKU_TOP src ;
93}
94if $(HAIKU_INCLUDE_3RDPARTY) {
95	SubInclude HAIKU_TOP 3rdparty ;
96}
97
98# Perform deferred SubIncludes.
99ExecuteDeferredSubIncludes ;
100
101# reset subdir
102SubDir HAIKU_TOP ;
103
104# Execute post-build-target user config rules.
105UserBuildConfigRulePostBuildTargets	;
106
107# specify the Haiku repository contents
108include [ FDirName $(HAIKU_BUILD_RULES_DIR) repositories Haiku ] ;
109
110# specify the actual Haiku image contents
111include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuImage ] ;
112
113# specify the additional image contents one for each boot type
114include [ FDirName $(HAIKU_BUILD_RULES_DIR) images NetBootArchive ] ;
115include [ FDirName $(HAIKU_BUILD_RULES_DIR) images FloppyBootImage ] ;
116include [ FDirName $(HAIKU_BUILD_RULES_DIR) images CDBootImage ] ;
117include [ FDirName $(HAIKU_BUILD_RULES_DIR) images HaikuCD ] ;
118include [ FDirName $(HAIKU_BUILD_RULES_DIR) images AnybootImage ] ;
119include [ FDirName $(HAIKU_BUILD_RULES_DIR) images MMCImage ] ;
120
121# Check whether all requested optional packages do actually exist.
122local package ;
123local packageError ;
124for package in $(HAIKU_ADDED_OPTIONAL_PACKAGES) {
125	if ! [ on $(package) return $(HAIKU_OPTIONAL_PACKAGE_EXISTS) ] {
126		Echo "ERROR: Requested optional package \"$(package)\" does not"
127			"exist." ;
128		packageError = 1 ;
129	}
130}
131if $(packageError) {
132	Exit ;
133}
134
135# Pseudo-target to build all targets that are localized.
136NotFile LocalizedTargets ;
137Depends LocalizedTargets : $(HAIKU_LOCALIZED_TARGETS) ;
138
139NotFile catalogs ;
140Depends catalogs : $(HAIKU_LOCALE_CATALOGS) ;
141
142NotFile catkeys ;
143Depends catkeys : $(HAIKU_LOCALE_OUTPUT_CATKEYS) ;
144