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