xref: /haiku/build/jam/BuildFeatures (revision 0754c319592cd8a523959d85fb06ab23c64a98a6)
1# This file contains setup for build features that require external packages. It
2# is included once for each configured packaging architecture (with
3# TARGET_PACKAGING_ARCH set accordingly).
4
5
6local architecture = $(TARGET_PACKAGING_ARCH) ;
7local secondaryArchSubDir = [ MultiArchIfPrimary "" : /$(architecture) ] ;
8local developLibDir = develop/lib$(secondaryArchSubDir) ;
9local developHeadersDir = develop/headers$(secondaryArchSubDir) ;
10
11
12# SSL
13
14# Automatically enable the SSL feature, when the OpenSSL package is enabled.
15if [ IsHaikuImagePackageAdded openssl ] {
16	HAIKU_BUILD_FEATURE_SSL = 1 ;
17}
18
19if $(HAIKU_BUILD_FEATURE_SSL) {
20	if [ IsPackageAvailable openssl_devel ] {
21		ExtractBuildFeatureArchives openssl :
22			file: base openssl
23				runtime: lib
24			file: devel openssl_devel
25				depends: base
26				libraries:
27					$(developLibDir)/libcrypto.so
28					$(developLibDir)/libssl.so
29				headers: $(developHeadersDir)
30			;
31
32		EnableBuildFeatures openssl ;
33	} else {
34		Echo "SSL build feature not available for $(TARGET_PACKAGING_ARCH)" ;
35	}
36}
37
38
39# ICU
40
41# Note ICU isn't actually optional, but is still an external package
42if [ IsPackageAvailable icu_devel ] {
43	ExtractBuildFeatureArchives icu :
44		file: base icu
45			runtime: lib
46		file: devel icu_devel
47			depends: base
48			libraries:
49				$(developLibDir)/libicudata.so
50				$(developLibDir)/libicui18n.so
51				$(developLibDir)/libicuio.so
52				$(developLibDir)/libicule.so
53				$(developLibDir)/libiculx.so
54				$(developLibDir)/libicutu.so
55				$(developLibDir)/libicuuc.so
56			headers: $(developHeadersDir)
57		;
58
59	EnableBuildFeatures icu ;
60} else  {
61	Echo "ICU not available for $(TARGET_PACKAGING_ARCH)" ;
62}
63
64
65# curl
66if [ IsPackageAvailable curl_devel ] {
67	ExtractBuildFeatureArchives curl :
68		file: base curl
69			runtime: lib
70		file: devel curl_devel
71			depends: base
72			library:
73				$(developLibDir)/libcurl.so
74			headers: $(developHeadersDir) $(developHeadersDir)/curl
75		;
76
77	EnableBuildFeatures curl ;
78} else  {
79	Echo "Curl not available for $(TARGET_PACKAGING_ARCH)" ;
80}
81
82
83# CLucene
84
85# TODO: Update to packages!
86if ! 1 {
87
88# Automatically install the CLucene feature, when the CLucene package is
89# enabled.
90if [ IsHaikuImagePackageAdded clucene ] {
91	HAIKU_BUILD_FEATURE_CLUCENE = 1 ;
92}
93
94
95HAIKU_CLUCENE_PACKAGE = clucene-0.9.21-x86-gcc4-haiku-2009-08-11.zip ;
96HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ;
97
98if $(HAIKU_BUILD_FEATURE_CLUCENE) {
99	if $(TARGET_ARCH) != x86 {
100		Echo "CLucene build feature not available for"
101			"$(TARGET_PACKAGING_ARCH)" ;
102	} else {
103		# Download the zip archive.
104		local zipFile = [ DownloadFile $(HAIKU_CLUCENE_PACKAGE)
105			: $(HAIKU_CLUCENE_URL) ] ;
106
107		# zip file and output directory
108		HAIKU_CLUCENE_ZIP_FILE = $(zipFile) ;
109		HAIKU_CLUCENE_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
110			$(HAIKU_CLUCENE_PACKAGE:B) ] ;
111
112		# extract headers and libraries
113		HAIKU_CLUCENE_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_CLUCENE_DIR)
114			: common/include/ : $(zipFile) : extracted-clucene
115		] ;
116
117		HAIKU_CLUCENE_LIBS = [ ExtractArchive $(HAIKU_CLUCENE_DIR)
118			:
119			common/lib/libclucene.a
120			: $(zipFile)
121			 : extracted-clucene
122		] ;
123
124		HAIKU_CLUCENE_HEADERS
125			= [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ;
126
127		EnableBuildFeatures clucene ;
128	}
129}
130
131} # ! 1
132
133
134# GLU (GL Utilities)
135if [ IsPackageAvailable glu_devel ] {
136	ExtractBuildFeatureArchives glu :
137		file: base glu
138			runtime: lib
139		file: devel glu_devel
140			depends: base
141			library: $(developLibDir)/libGLU.so
142			headers: $(developHeadersDir)
143		;
144
145	EnableBuildFeatures glu ;
146} else {
147	Echo "GLU not yet available on $(TARGET_PACKAGING_ARCH)" ;
148}
149
150
151# GL (GL Kit, Mesa3D)
152if [ IsPackageAvailable mesa_devel ] {
153	ExtractBuildFeatureArchives mesa :
154		file: base mesa
155			runtime: lib
156		file: devel mesa_devel
157			depends: base
158			library: $(developLibDir)/libGL.so
159			headers: $(developHeadersDir)/os/opengl
160		;
161
162	EnableBuildFeatures mesa ;
163} else {
164	Echo "GL not yet available on $(TARGET_PACKAGING_ARCH)" ;
165}
166
167
168# FFmpeg
169if [ IsPackageAvailable ffmpeg_devel ] {
170	local ffmpegLibs = libavformat.so libavcodec.so libavdevice.so
171		libavfilter.so libswscale.so libavutil.so ;
172
173	ExtractBuildFeatureArchives ffmpeg :
174		file: base ffmpeg
175			runtime: lib
176		file: devel ffmpeg_devel
177			depends: base
178			libraries: $(developLibDir)/$(ffmpegLibs)
179			headers: $(developHeadersDir)
180		;
181
182	EnableBuildFeatures ffmpeg ;
183
184} else {
185	Echo "FFMpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
186}
187
188
189# Freetype
190if [ IsPackageAvailable freetype_devel ] {
191	ExtractBuildFeatureArchives freetype :
192		file: base freetype
193			runtime: lib
194		file: devel freetype_devel
195			depends: base
196			library: $(developLibDir)/libfreetype.so
197			headers: $(developHeadersDir) $(developHeadersDir)/freetype2
198		;
199
200	EnableBuildFeatures freetype ;
201} else {
202	Echo "Freetype support not available on $(TARGET_PACKAGING_ARCH)" ;
203}
204
205
206# Gutenprint
207if [ IsPackageAvailable gutenprint_devel ] {
208	ExtractBuildFeatureArchives gutenprint :
209		file: base gutenprint
210			runtime: lib
211		file: devel gutenprint_devel
212			depends: base
213			library: $(developLibDir)/libgutenprint.so
214			headers: $(developHeadersDir) $(developHeadersDir)/gutenprint
215		;
216
217	EnableBuildFeatures gutenprint ;
218} else {
219	Echo "Gutenprint support not available on $(TARGET_PACKAGING_ARCH)" ;
220}
221
222
223# TagLib
224
225# TODO: Update to packages!
226if ! 1 {
227
228# Automatically install the TagLib feature, when the optional TagLib optional
229# package is enabled.
230if [ IsHaikuImagePackageAdded taglib ] {
231	HAIKU_BUILD_FEATURE_TAGLIB = 1 ;
232}
233
234HAIKU_TAGLIB_PACKAGE = taglib-1.6.3-r1a4-x86-gcc2-2012-09-03.zip ;
235HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ;
236
237if $(HAIKU_BUILD_FEATURE_TAGLIB) {
238	if $(TARGET_ARCH) != x86 {
239		Echo "TagLib build feature not available for $(TARGET_PACKAGING_ARCH)" ;
240	} else {
241		# Download the zip archive.
242		local zipFile = [ DownloadFile $(HAIKU_TAGLIB_PACKAGE)
243			: $(HAIKU_TAGLIB_URL) ] ;
244
245		# zip file and output directory
246		HAIKU_TAGLIB_ZIP_FILE = $(zipFile) ;
247		HAIKU_TAGLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
248			$(HAIKU_TAGLIB_PACKAGE:B) ] ;
249
250		# extract headers and libraries
251		HAIKU_TAGLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
252			: common/include/ : $(zipFile) : extracted-taglib
253		] ;
254
255		HAIKU_TAGLIB_LIBS = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
256			:
257			common/lib/libtag.so
258			common/lib/libtag_c.so
259			: $(zipFile)
260			: extracted-taglib
261		] ;
262
263		HAIKU_TAGLIB_HEADERS
264			= [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ;
265
266		EnableBuildFeatures taglib ;
267	}
268}
269
270} # ! 1
271
272
273# WebKit
274if [ IsPackageAvailable haikuwebkit_devel ] {
275	ExtractBuildFeatureArchives webkit :
276		file: base haikuwebkit
277			runtime: lib
278		file: devel haikuwebkit_devel
279			depends: base
280			libraries:
281				$(developLibDir)/libWebKit.so
282			headers: $(developHeadersDir)
283		;
284
285	EnableBuildFeatures webkit ;
286} else {
287	Echo "WebKit build feature not available for $(TARGET_PACKAGING_ARCH)" ;
288}
289
290
291# libpng
292if [ IsPackageAvailable libpng_devel ] {
293	ExtractBuildFeatureArchives libpng :
294		file: base libpng
295			runtime: lib
296		file: devel libpng_devel
297			depends: base
298			library: $(developLibDir)/libpng.so
299			headers: $(developHeadersDir)
300		;
301
302	EnableBuildFeatures libpng ;
303} else {
304	Echo "libpng support not available on $(TARGET_PACKAGING_ARCH)" ;
305}
306
307
308# jpeg
309if [ IsPackageAvailable jpeg_devel ] {
310	ExtractBuildFeatureArchives jpeg :
311		file: base jpeg
312			runtime: lib
313		file: devel jpeg_devel
314			depends: base
315			library: $(developLibDir)/libjpeg.so
316			headers: $(developHeadersDir)
317		;
318
319	EnableBuildFeatures jpeg ;
320} else {
321	Echo "jpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
322}
323
324
325# zlib
326if [ IsPackageAvailable zlib_devel ] {
327	ExtractBuildFeatureArchives zlib :
328		file: base zlib
329			runtime: lib
330		file: devel zlib_devel
331			depends: base
332			library: $(developLibDir)/libz.so
333			headers: $(developHeadersDir)
334		# sources are required for the primary architecture only
335		primary @{
336			file: source zlib_source
337				sources: develop/sources/%portRevisionedName%/sources
338		}@
339		;
340
341	EnableBuildFeatures zlib ;
342} else {
343	Echo "zlib support not available on $(TARGET_PACKAGING_ARCH)" ;
344}
345
346
347# libsolv
348if [ IsPackageAvailable libsolv_devel ] {
349	ExtractBuildFeatureArchives libsolv :
350		file: base libsolv
351			runtime: lib
352		file: devel libsolv_devel
353			depends: base
354			libraries:
355				$(developLibDir)/libsolv.so
356				$(developLibDir)/libsolvext.so
357			headers: $(developHeadersDir)
358		# sources are required for the primary architecture only
359		primary @{
360			file: source libsolv_source
361				sources: develop/sources/%portRevisionedName%/sources
362		}@
363		;
364
365	EnableBuildFeatures libsolv ;
366} else {
367	Echo "libsolv package not available for $(TARGET_PACKAGING_ARCH)" ;
368}
369
370
371# qrencode
372if [ IsPackageAvailable qrencode_devel ] {
373	ExtractBuildFeatureArchives libqrencode :
374		file: base qrencode
375			runtime: lib
376		file: devel qrencode_devel
377			depends: base
378			library: $(developLibDir)/libqrencode.a
379			headers: $(developHeadersDir)
380		;
381
382	EnableBuildFeatures libqrencode ;
383} else {
384	Echo "qrencode support not available on $(TARGET_PACKAGING_ARCH)" ;
385}
386
387
388# tiff
389if [ IsPackageAvailable tiff_devel ] {
390	ExtractBuildFeatureArchives tiff :
391		file: base tiff
392			runtime: lib
393		file: devel tiff_devel
394			depends: base
395			library: $(developLibDir)/libtiff.so.3
396			headers: $(developHeadersDir) $(developHeadersDir)/tiff
397		;
398
399	EnableBuildFeatures tiff ;
400} else {
401	Echo "Tiff support not available on $(TARGET_PACKAGING_ARCH)" ;
402}
403
404
405
406# GPL add-ons
407if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
408	EnableBuildFeatures gpl ;
409}
410
411
412# ATA vs. IDE
413#HACK: remove when old ide code is removed!
414if $(HAIKU_ATA_STACK) = 1 {
415	EnableBuildFeatures ata ;
416} else {
417	EnableBuildFeatures ide ;
418}
419