xref: /haiku/build/jam/BuildFeatures (revision 94bf728825e8a3b408c28fe415422db4810f0015)
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# TODO: Update to packages!
135if ! 1 {
136
137# LLVM
138if $(TARGET_ARCH) = x86 {
139	if $(TARGET_GCC_VERSION_$(architecture)[1]) >= 4 {
140		HAIKU_LLVM_FILE = llvm-3.2-x86-gcc4-2012-12-21.zip ;
141		local zipFile = [ DownloadFile $(HAIKU_LLVM_FILE)
142			: $(baseURL)/$(HAIKU_LLVM_FILE) ] ;
143
144		HAIKU_LLVM_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
145			$(HAIKU_LLVM_FILE:B) ] ;
146
147		HAIKU_LLVM_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_LLVM_DIR)
148			: common/include/ : $(zipFile) : extracted-llvm ] ;
149		HAIKU_LLVM_HEADERS = [ FDirName $(HAIKU_LLVM_DIR) common include ] ;
150
151		# We can't Glob these because they aren't extracted yet.
152		HAIKU_LLVM_LIBS = [ ExtractArchive $(HAIKU_LLVM_DIR)
153			:
154			common/lib/libLLVMAsmParser.a
155			common/lib/libLLVMInstrumentation.a
156			common/lib/libLLVMLinker.a
157			common/lib/libLLVMArchive.a
158			common/lib/libLLVMBitReader.a
159			common/lib/libLLVMDebugInfo.a
160			common/lib/libLLVMJIT.a
161			common/lib/libLLVMipo.a
162			common/lib/libLLVMVectorize.a
163			common/lib/libLLVMBitWriter.a
164			common/lib/libLLVMTableGen.a
165			#common/lib/libLLVMHexagonCodeGen.a
166			#common/lib/libLLVMHexagonAsmPrinter.a
167			#common/lib/libLLVMHexagonDesc.a
168			#common/lib/libLLVMHexagonInfo.a
169			#common/lib/libLLVMNVPTXCodeGen.a
170			#common/lib/libLLVMNVPTXDesc.a
171			#common/lib/libLLVMNVPTXInfo.a
172			#common/lib/libLLVMNVPTXAsmPrinter.a
173			#common/lib/libLLVMMBlazeCodeGen.a
174			#common/lib/libLLVMMBlazeAsmParser.a
175			#common/lib/libLLVMMBlazeDisassembler.a
176			#common/lib/libLLVMMBlazeDesc.a
177			#common/lib/libLLVMMBlazeInfo.a
178			#common/lib/libLLVMMBlazeAsmPrinter.a
179			common/lib/libLLVMCppBackendCodeGen.a
180			common/lib/libLLVMCppBackendInfo.a
181			#common/lib/libLLVMMSP430CodeGen.a
182			#common/lib/libLLVMMSP430Desc.a
183			#common/lib/libLLVMMSP430AsmPrinter.a
184			#common/lib/libLLVMMSP430Info.a
185			#common/lib/libLLVMXCoreCodeGen.a
186			#common/lib/libLLVMXCoreDesc.a
187			#common/lib/libLLVMXCoreInfo.a
188			#common/lib/libLLVMCellSPUCodeGen.a
189			#common/lib/libLLVMCellSPUDesc.a
190			#common/lib/libLLVMCellSPUInfo.a
191			#common/lib/libLLVMMipsAsmParser.a
192			#common/lib/libLLVMMipsCodeGen.a
193			#common/lib/libLLVMMipsDesc.a
194			#common/lib/libLLVMMipsAsmPrinter.a
195			#common/lib/libLLVMMipsDisassembler.a
196			#common/lib/libLLVMMipsInfo.a
197			#common/lib/libLLVMARMAsmParser.a
198			#common/lib/libLLVMARMCodeGen.a
199			#common/lib/libLLVMARMDisassembler.a
200			#common/lib/libLLVMARMDesc.a
201			#common/lib/libLLVMARMInfo.a
202			#common/lib/libLLVMARMAsmPrinter.a
203			#common/lib/libLLVMPowerPCCodeGen.a
204			#common/lib/libLLVMPowerPCDesc.a
205			#common/lib/libLLVMPowerPCInfo.a
206			#common/lib/libLLVMPowerPCAsmPrinter.a
207			#common/lib/libLLVMSparcCodeGen.a
208			#common/lib/libLLVMSparcDesc.a
209			#common/lib/libLLVMSparcInfo.a
210			common/lib/libLLVMX86AsmParser.a
211			common/lib/libLLVMX86CodeGen.a
212			common/lib/libLLVMSelectionDAG.a
213			common/lib/libLLVMAsmPrinter.a
214			common/lib/libLLVMX86Disassembler.a
215			common/lib/libLLVMX86Desc.a
216			common/lib/libLLVMX86Info.a
217			common/lib/libLLVMX86AsmPrinter.a
218			common/lib/libLLVMX86Utils.a
219			common/lib/libLLVMMCDisassembler.a
220			common/lib/libLLVMMCParser.a
221			common/lib/libLLVMInterpreter.a
222			common/lib/libLLVMCodeGen.a
223			common/lib/libLLVMScalarOpts.a
224			common/lib/libLLVMInstCombine.a
225			common/lib/libLLVMTransformUtils.a
226			common/lib/libLLVMipa.a
227			common/lib/libLLVMAnalysis.a
228			common/lib/libLLVMMCJIT.a
229			common/lib/libLLVMRuntimeDyld.a
230			common/lib/libLLVMExecutionEngine.a
231			common/lib/libLLVMTarget.a
232			common/lib/libLLVMMC.a
233			common/lib/libLLVMObject.a
234			common/lib/libLLVMCore.a
235			common/lib/libLLVMSupport.a
236			: $(zipFile) : extracted-llvm ]
237		;
238
239		EnableBuildFeatures llvm ;
240	} else {
241		# Nor will it ever be
242		Echo "LLVM not available on GCC2" ;
243	}
244} else {
245	Echo "LLVM not yet available on $(TARGET_PACKAGING_ARCH)" ;
246}
247
248} # ! 1
249
250
251# GLU (GL Utilities)
252if [ IsPackageAvailable glu_devel ] {
253	ExtractBuildFeatureArchives glu :
254		file: base glu
255			runtime: lib
256		file: devel glu_devel
257			depends: base
258			library: $(developLibDir)/libGLU.so
259			headers: $(developHeadersDir)
260		;
261
262	EnableBuildFeatures glu ;
263} else {
264	Echo "GLU not yet available on $(TARGET_PACKAGING_ARCH)" ;
265}
266
267
268# Mesa
269if [ IsPackageAvailable mesa_devel ] {
270	ExtractBuildFeatureArchives mesa : [ FFilterByBuildFeatures
271		file: devel mesa_devel
272			mesaLibrary: $(developLibDir)/libmesa.a
273			glapiLibrary: $(developLibDir)/libglapi.a
274			headers: $(developHeadersDir)
275			privateHeaders: $(developHeadersDir)/mesa_private
276
277			!gcc2 @{
278				glslLibrary: $(developLibDir)/libglsl.a
279				galliumLibrary: $(developLibDir)/libgallium.a
280				llvm @{
281					galliumLlvmpipeLibrary: $(developLibDir)/libllvmpipe.a
282				}@
283				!llvm @{
284					galliumSoftpipeLibrary: $(developLibDir)/libsoftpipe.a
285				}@
286			}@ # !gcc2
287		] ;
288
289	Depends [ BuildFeatureAttribute mesa : galliumLlvmpipeLibrary ]
290		: $(HAIKU_LLVM_LIBS) ;
291
292	EnableBuildFeatures mesa ;
293} else {
294	Echo "Mesa 3D rendering support not available on $(TARGET_PACKAGING_ARCH)" ;
295}
296
297
298# FFmpeg
299if [ IsPackageAvailable ffmpeg_devel ] {
300	local ffmpegLibs = libavformat.so libavcodec.so libavdevice.so
301		libavfilter.so libswscale.so libavutil.so ;
302	local speexLibs = libspeex.so ;
303	local libtheoraLibs = libtheora.so libtheoradec.so libtheoraenc.so ;
304	local libvorbisLibs = libvorbis.so libvorbisenc.so ;
305	local liboggLibs = libogg.so ;
306	local libvpxLibs = libvpx.so ;
307
308	local feature ;
309	for feature in ffmpeg speex libtheora libvorbis libogg libvpx {
310		ExtractBuildFeatureArchives $(feature) :
311			file: base $(feature)
312				runtime: lib
313			file: devel $(feature)_devel
314				depends: base
315				libraries: $(developLibDir)/$($(feature)Libs)
316				headers: $(developHeadersDir)
317			;
318
319		EnableBuildFeatures $(feature) ;
320	}
321} else {
322	Echo "FFMpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
323}
324
325
326# Freetype
327if [ IsPackageAvailable freetype_devel ] {
328	ExtractBuildFeatureArchives freetype :
329		file: base freetype
330			runtime: lib
331		file: devel freetype_devel
332			depends: base
333			library: $(developLibDir)/libfreetype.so
334			headers: $(developHeadersDir) $(developHeadersDir)/freetype2
335		;
336
337	EnableBuildFeatures freetype ;
338} else {
339	Echo "Freetype support not available on $(TARGET_PACKAGING_ARCH)" ;
340}
341
342
343# TagLib
344
345# TODO: Update to packages!
346if ! 1 {
347
348# Automatically install the TagLib feature, when the optional TagLib optional
349# package is enabled.
350if [ IsHaikuImagePackageAdded taglib ] {
351	HAIKU_BUILD_FEATURE_TAGLIB = 1 ;
352}
353
354HAIKU_TAGLIB_PACKAGE = taglib-1.6.3-r1a4-x86-gcc2-2012-09-03.zip ;
355HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ;
356
357if $(HAIKU_BUILD_FEATURE_TAGLIB) {
358	if $(TARGET_ARCH) != x86 {
359		Echo "TagLib build feature not available for $(TARGET_PACKAGING_ARCH)" ;
360	} else {
361		# Download the zip archive.
362		local zipFile = [ DownloadFile $(HAIKU_TAGLIB_PACKAGE)
363			: $(HAIKU_TAGLIB_URL) ] ;
364
365		# zip file and output directory
366		HAIKU_TAGLIB_ZIP_FILE = $(zipFile) ;
367		HAIKU_TAGLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
368			$(HAIKU_TAGLIB_PACKAGE:B) ] ;
369
370		# extract headers and libraries
371		HAIKU_TAGLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
372			: common/include/ : $(zipFile) : extracted-taglib
373		] ;
374
375		HAIKU_TAGLIB_LIBS = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
376			:
377			common/lib/libtag.so
378			common/lib/libtag_c.so
379			: $(zipFile)
380			: extracted-taglib
381		] ;
382
383		HAIKU_TAGLIB_HEADERS
384			= [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ;
385
386		EnableBuildFeatures taglib ;
387	}
388}
389
390} # ! 1
391
392
393# WebKit
394if [ IsPackageAvailable haikuwebkit_devel ] {
395	ExtractBuildFeatureArchives webkit :
396		file: base haikuwebkit
397			runtime: lib
398		file: devel haikuwebkit_devel
399			depends: base
400			libraries:
401				$(developLibDir)/libwtf.so
402				$(developLibDir)/libjavascriptcore.so
403				$(developLibDir)/libwebcore.so
404				$(developLibDir)/libwebkit.so
405			headers: $(developHeadersDir)
406		;
407
408	EnableBuildFeatures webkit ;
409} else {
410	Echo "WebKit build feature not available for $(TARGET_PACKAGING_ARCH)" ;
411}
412
413
414# libpng
415if [ IsPackageAvailable libpng_devel ] {
416	ExtractBuildFeatureArchives libpng :
417		file: base libpng
418			runtime: lib
419		file: devel libpng_devel
420			depends: base
421			library: $(developLibDir)/libpng.so
422			headers: $(developHeadersDir)
423		;
424
425	EnableBuildFeatures libpng ;
426} else {
427	Echo "libpng support not available on $(TARGET_PACKAGING_ARCH)" ;
428}
429
430
431# jpeg
432if [ IsPackageAvailable jpeg_devel ] {
433	ExtractBuildFeatureArchives jpeg :
434		file: base jpeg
435			runtime: lib
436		file: devel jpeg_devel
437			depends: base
438			library: $(developLibDir)/libjpeg.so
439			headers: $(developHeadersDir)
440		;
441
442	EnableBuildFeatures jpeg ;
443} else {
444	Echo "jpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
445}
446
447
448# zlib
449if [ IsPackageAvailable zlib_devel ] {
450	ExtractBuildFeatureArchives zlib :
451		file: base zlib
452			runtime: lib
453		file: devel zlib_devel
454			depends: base
455			library: $(developLibDir)/libz.so
456			headers: $(developHeadersDir)
457		# sources are required for the primary architecture only
458		primary @{
459			file: source zlib_source
460				sources: develop/sources/%portRevisionedName%/sources
461		}@
462		;
463
464	EnableBuildFeatures zlib ;
465} else {
466	Echo "zlib support not available on $(TARGET_PACKAGING_ARCH)" ;
467}
468
469
470# libsolv
471if [ IsPackageAvailable libsolv_devel ] {
472	ExtractBuildFeatureArchives libsolv :
473		file: base libsolv
474			runtime: lib
475		file: devel libsolv_devel
476			depends: base
477			libraries:
478				$(developLibDir)/libsolv.so
479				$(developLibDir)/libsolvext.so
480			headers: $(developHeadersDir)
481		# sources are required for the primary architecture only
482		primary @{
483			file: source libsolv_source
484				sources: develop/sources/%portRevisionedName%/sources
485		}@
486		;
487
488	EnableBuildFeatures libsolv ;
489} else {
490	Echo "libsolv package not available for $(TARGET_PACKAGING_ARCH)" ;
491}
492
493
494# GPL add-ons
495if $(HAIKU_INCLUDE_GPL_ADDONS) = 1 {
496	EnableBuildFeatures gpl ;
497}
498
499
500# ATA vs. IDE
501#HACK: remove when old ide code is removed!
502if $(HAIKU_ATA_STACK) = 1 {
503	EnableBuildFeatures ata ;
504} else {
505	EnableBuildFeatures ide ;
506}
507