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