xref: /haiku/build/jam/BuildFeatures (revision 3369e03d5cde9709c8aa70c99bfe6ce24ba65bf9)
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 libDir = lib$(secondaryArchSubDir) ;
9local developLibDir = develop/lib$(secondaryArchSubDir) ;
10local developHeadersDir = develop/headers$(secondaryArchSubDir) ;
11
12
13# SSL
14
15# Automatically enable the SSL feature, when the OpenSSL package is enabled.
16if [ IsHaikuImagePackageAdded openssl ] {
17	HAIKU_BUILD_FEATURE_SSL = 1 ;
18}
19
20if $(HAIKU_BUILD_FEATURE_SSL) {
21	if [ IsPackageAvailable openssl_devel ] {
22		ExtractBuildFeatureArchives openssl :
23			file: base openssl
24				runtime: lib
25			file: devel openssl_devel
26				depends: base
27				libraries:
28					$(developLibDir)/libcrypto.so
29					$(developLibDir)/libssl.so
30				headers: $(developHeadersDir)
31			;
32
33		EnableBuildFeatures openssl ;
34	} else {
35		Echo "SSL build feature not available for $(TARGET_PACKAGING_ARCH)" ;
36	}
37}
38
39
40# gcc_syslibs
41
42if $(TARGET_PACKAGING_ARCH) != x86_gcc2 {
43	if [ IsPackageAvailable gcc_syslibs ] {
44		ExtractBuildFeatureArchives gcc_syslibs :
45			file: base gcc_syslibs
46				libgcc_s.so.1: $(libDir)/libgcc_s.so.1
47				libstdc++.so: $(libDir)/libstdc++.so
48				libsupc++.so: $(libDir)/libsupc++.so
49			;
50
51		EnableBuildFeatures gcc_syslibs ;
52	} else {
53		Echo "gcc_syslibs not available for $(TARGET_PACKAGING_ARCH)" ;
54	}
55}
56
57
58# gcc_syslibs_devel
59
60if [ IsPackageAvailable gcc_syslibs_devel ] {
61	if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
62		ExtractBuildFeatureArchives gcc_syslibs_devel :
63			file: base gcc_syslibs_devel
64				libgcc.a: $(developLibDir)/libgcc.a
65				libgcc_eh.a:
66				libgcc-kernel.a: $(developLibDir)/libgcc.a
67				libgcc_eh-kernel.a:
68				libstdc++.a:
69				libsupc++.a:
70				libsupc++-kernel.a:
71			;
72	} else {
73		ExtractBuildFeatureArchives gcc_syslibs_devel :
74			file: base gcc_syslibs_devel
75				libgcc.a: $(developLibDir)/libgcc.a
76				libgcc_eh.a: $(developLibDir)/libgcc_eh.a
77				libgcc-kernel.a: $(developLibDir)/libgcc-kernel.a
78				libgcc_eh-kernel.a: $(developLibDir)/libgcc_eh.a
79				libstdc++.a: $(developLibDir)/libstdc++.a
80				libsupc++.a: $(developLibDir)/libsupc++.a
81				libsupc++-kernel.a: $(developLibDir)/libsupc++-kernel.a
82				c++-headers: $(developHeadersDir)/c++
83				gcc-headers: $(developHeadersDir)/gcc
84			;
85	}
86
87	EnableBuildFeatures gcc_syslibs_devel ;
88} else {
89	Echo "gcc_syslibs_devel not available for $(TARGET_PACKAGING_ARCH)" ;
90}
91
92
93# ICU
94
95if [ IsPackageAvailable icu_devel ] {
96	ExtractBuildFeatureArchives icu :
97		file: base icu
98			runtime: lib
99		file: devel icu_devel
100			depends: base
101			libraries:
102				$(developLibDir)/libicudata.so
103				$(developLibDir)/libicui18n.so
104				$(developLibDir)/libicuio.so
105				$(developLibDir)/libicule.so
106				$(developLibDir)/libiculx.so
107				$(developLibDir)/libicutu.so
108				$(developLibDir)/libicuuc.so
109			headers: $(developHeadersDir)
110		;
111
112	EnableBuildFeatures icu ;
113} else {
114	Echo "ICU not available for $(TARGET_PACKAGING_ARCH)" ;
115}
116
117
118# CLucene
119
120# TODO: Update to packages!
121if ! 1 {
122
123# Automatically install the CLucene feature, when the CLucene package is
124# enabled.
125if [ IsHaikuImagePackageAdded clucene ] {
126	HAIKU_BUILD_FEATURE_CLUCENE = 1 ;
127}
128
129
130HAIKU_CLUCENE_PACKAGE = clucene-0.9.21-x86-gcc4-haiku-2009-08-11.zip ;
131HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ;
132
133if $(HAIKU_BUILD_FEATURE_CLUCENE) {
134	if $(TARGET_ARCH) != x86 {
135		Echo "CLucene build feature not available for"
136			"$(TARGET_PACKAGING_ARCH)" ;
137	} else {
138		# Download the zip archive.
139		local zipFile = [ DownloadFile $(HAIKU_CLUCENE_PACKAGE)
140			: $(HAIKU_CLUCENE_URL) ] ;
141
142		# zip file and output directory
143		HAIKU_CLUCENE_ZIP_FILE = $(zipFile) ;
144		HAIKU_CLUCENE_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
145			$(HAIKU_CLUCENE_PACKAGE:B) ] ;
146
147		# extract headers and libraries
148		HAIKU_CLUCENE_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_CLUCENE_DIR)
149			: common/include/ : $(zipFile) : extracted-clucene
150		] ;
151
152		HAIKU_CLUCENE_LIBS = [ ExtractArchive $(HAIKU_CLUCENE_DIR)
153			:
154			common/lib/libclucene.a
155			: $(zipFile)
156			 : extracted-clucene
157		] ;
158
159		HAIKU_CLUCENE_HEADERS
160			= [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ;
161
162		EnableBuildFeatures clucene ;
163	}
164}
165
166} # ! 1
167
168
169# Giflib
170if [ IsPackageAvailable giflib_devel ] {
171	ExtractBuildFeatureArchives giflib :
172		file: base giflib
173			runtime: lib
174		file: devel giflib_devel
175			depends: base
176			library: $(developLibDir)/libgif.so.7
177			headers: $(developHeadersDir)
178		;
179
180	EnableBuildFeatures giflib ;
181} else {
182	Echo "Giflib support not available on $(TARGET_PACKAGING_ARCH)" ;
183}
184
185
186# GLU (GL Utilities)
187if [ IsPackageAvailable glu_devel ] {
188	ExtractBuildFeatureArchives glu :
189		file: base glu
190			runtime: lib
191		file: devel glu_devel
192			depends: base
193			library: $(developLibDir)/libGLU.so
194			headers: $(developHeadersDir)
195		;
196
197	EnableBuildFeatures glu ;
198} else {
199	Echo "GLU not yet available on $(TARGET_PACKAGING_ARCH)" ;
200}
201
202
203# GL (GL Kit, Mesa3D)
204if [ IsPackageAvailable mesa_devel ] {
205	ExtractBuildFeatureArchives mesa :
206		file: base mesa
207			runtime: lib
208		file: devel mesa_devel
209			depends: base
210			library: $(developLibDir)/libGL.so
211			headers: $(developHeadersDir)/os/opengl
212		;
213
214	EnableBuildFeatures mesa ;
215} else {
216	Echo "GL not yet available on $(TARGET_PACKAGING_ARCH)" ;
217}
218
219
220# FFmpeg
221if [ IsPackageAvailable ffmpeg_devel ] {
222	local ffmpegLibs = libavformat.so libavcodec.so libavfilter.so libswscale.so
223		libavutil.so libswresample.so ;
224
225	ExtractBuildFeatureArchives ffmpeg :
226		file: base ffmpeg
227			runtime: lib
228		file: devel ffmpeg_devel
229			depends: base
230			libraries: $(developLibDir)/$(ffmpegLibs)
231			headers: $(developHeadersDir)
232		;
233
234	EnableBuildFeatures ffmpeg ;
235
236} else {
237	Echo "FFMpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
238}
239
240
241# Fluidlite
242if [ IsPackageAvailable fluidlite_devel ] && [ IsPackageAvailable libvorbis_devel ] {
243	ExtractBuildFeatureArchives fluidlite :
244		file: devel fluidlite_devel
245			library: $(developLibDir)/libfluidlite.a
246			headers: $(developHeadersDir)
247		;
248
249	EnableBuildFeatures fluidlite ;
250} else {
251	Echo "Fluidlite support not available on $(TARGET_PACKAGING_ARCH)" ;
252}
253
254
255# Libvorbis
256if [ IsPackageAvailable libvorbis_devel ] {
257	ExtractBuildFeatureArchives libvorbis :
258		file: base libvorbis
259			runtime: lib
260		file: devel libvorbis_devel
261			depends: base
262			library: $(developLibDir)/libvorbisfile.so.3
263			headers: $(developHeadersDir)
264		;
265
266	EnableBuildFeatures libvorbis ;
267} else {
268	Echo "Libvorbis support not available on $(TARGET_PACKAGING_ARCH)" ;
269}
270
271
272# Freetype
273if [ IsPackageAvailable freetype_devel ] {
274	ExtractBuildFeatureArchives freetype :
275		file: base freetype
276			runtime: lib
277		file: devel freetype_devel
278			depends: base
279			library: $(developLibDir)/libfreetype.so
280			headers: $(developHeadersDir) $(developHeadersDir)/freetype2
281		;
282
283	EnableBuildFeatures freetype ;
284} else {
285	Echo "Freetype support not available on $(TARGET_PACKAGING_ARCH)" ;
286}
287
288# fontconfig
289if [ IsPackageAvailable fontconfig_devel ] {
290	ExtractBuildFeatureArchives fontconfig :
291		file: base fontconfig
292			runtime: lib
293		file: devel fontconfig_devel
294			depends: base
295			library: $(developLibDir)/libfontconfig.so
296			headers: $(developHeadersDir) $(developHeadersDir)/fontconfig
297		;
298
299	EnableBuildFeatures fontconfig ;
300} else {
301	Echo "fontconfig support not available on $(TARGET_PACKAGING_ARCH)" ;
302}
303
304# Gutenprint
305if [ IsPackageAvailable gutenprint_devel ] {
306	ExtractBuildFeatureArchives gutenprint :
307		file: base gutenprint
308			runtime: lib
309		file: devel gutenprint_devel
310			depends: base
311			library: $(developLibDir)/libgutenprint.so
312			headers: $(developHeadersDir) $(developHeadersDir)/gutenprint
313		;
314
315	EnableBuildFeatures gutenprint ;
316} else {
317	Echo "Gutenprint support not available on $(TARGET_PACKAGING_ARCH)" ;
318}
319
320
321# TagLib
322
323# TODO: Update to packages!
324if ! 1 {
325
326# Automatically install the TagLib feature, when the optional TagLib optional
327# package is enabled.
328if [ IsHaikuImagePackageAdded taglib ] {
329	HAIKU_BUILD_FEATURE_TAGLIB = 1 ;
330}
331
332HAIKU_TAGLIB_PACKAGE = taglib-1.6.3-r1a4-x86-gcc2-2012-09-03.zip ;
333HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ;
334
335if $(HAIKU_BUILD_FEATURE_TAGLIB) {
336	if $(TARGET_ARCH) != x86 {
337		Echo "TagLib build feature not available for $(TARGET_PACKAGING_ARCH)" ;
338	} else {
339		# Download the zip archive.
340		local zipFile = [ DownloadFile $(HAIKU_TAGLIB_PACKAGE)
341			: $(HAIKU_TAGLIB_URL) ] ;
342
343		# zip file and output directory
344		HAIKU_TAGLIB_ZIP_FILE = $(zipFile) ;
345		HAIKU_TAGLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
346			$(HAIKU_TAGLIB_PACKAGE:B) ] ;
347
348		# extract headers and libraries
349		HAIKU_TAGLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
350			: common/include/ : $(zipFile) : extracted-taglib
351		] ;
352
353		HAIKU_TAGLIB_LIBS = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
354			:
355			common/lib/libtag.so
356			common/lib/libtag_c.so
357			: $(zipFile)
358			: extracted-taglib
359		] ;
360
361		HAIKU_TAGLIB_HEADERS
362			= [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ;
363
364		EnableBuildFeatures taglib ;
365	}
366}
367
368} # ! 1
369
370
371# WebKit
372if [ IsPackageAvailable haikuwebkit_devel ] {
373	ExtractBuildFeatureArchives webkit :
374		file: base haikuwebkit
375			runtime: lib
376		file: devel haikuwebkit_devel
377			depends: base
378			libraries:
379				$(developLibDir)/libWebKitLegacy.so
380			headers: $(developHeadersDir)
381		;
382
383	EnableBuildFeatures webkit ;
384} else {
385	Echo "WebKit build feature not available for $(TARGET_PACKAGING_ARCH)" ;
386}
387
388
389# libpng
390if [ IsPackageAvailable libpng16_devel ] {
391	ExtractBuildFeatureArchives libpng :
392		file: base libpng16
393			runtime: lib
394		file: devel libpng16_devel
395			depends: base
396			library: $(developLibDir)/libpng16.so
397			headers: $(developHeadersDir)
398		;
399
400	EnableBuildFeatures libpng ;
401} else {
402	Echo "libpng support not available on $(TARGET_PACKAGING_ARCH)" ;
403}
404
405
406# libicns
407if [ IsPackageAvailable libicns_devel ] {
408	ExtractBuildFeatureArchives libicns :
409		file: base libicns
410			runtime: lib
411		file: devel libicns_devel
412			depends: base
413			library: $(developLibDir)/libicns.so.1
414			headers: $(developHeadersDir)
415		;
416
417	EnableBuildFeatures libicns ;
418} else {
419	Echo "libicns support not available on $(TARGET_PACKAGING_ARCH)" ;
420}
421
422
423# Jasper
424if [ IsPackageAvailable jasper_devel ] {
425	ExtractBuildFeatureArchives jasper :
426		file: base jasper
427			runtime: lib
428		file: devel jasper_devel
429			depends: base
430			library: $(developLibDir)/libjasper.so.4
431			headers: $(developHeadersDir) $(developHeadersDir)/jasper
432		;
433
434	EnableBuildFeatures jasper ;
435} else {
436	Echo "Jasper support not available on $(TARGET_PACKAGING_ARCH)" ;
437}
438
439
440# jpeg
441if [ IsPackageAvailable jpeg_devel ] {
442	ExtractBuildFeatureArchives jpeg :
443		file: base jpeg
444			runtime: lib
445		file: devel jpeg_devel
446			depends: base
447			library: $(developLibDir)/libjpeg.so
448			headers: $(developHeadersDir)
449		;
450
451	EnableBuildFeatures jpeg ;
452} else {
453	Echo "jpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
454}
455
456
457# zlib
458if [ IsPackageAvailable zlib_devel ] {
459	ExtractBuildFeatureArchives zlib :
460		file: base zlib
461			runtime: lib
462		file: devel zlib_devel
463			depends: base
464			library: $(developLibDir)/libz.so
465			headers: $(developHeadersDir)
466		# sources are required for the primary architecture only
467		primary @{
468			file: source zlib_source
469				sources: develop/sources/%portRevisionedName%/sources
470		}@
471		;
472
473	EnableBuildFeatures zlib ;
474} else {
475	Echo "zlib support not available on $(TARGET_PACKAGING_ARCH)" ;
476}
477
478
479# libedit
480if [ IsPackageAvailable libedit_devel ] {
481	ExtractBuildFeatureArchives libedit :
482		file: base libedit
483			runtime: lib
484		file: devel libedit_devel
485			depends: base
486			library: $(developLibDir)/libedit.so
487			headers: $(developHeadersDir)
488		;
489
490	EnableBuildFeatures libedit ;
491} else {
492	Echo "libedit support not available on $(TARGET_PACKAGING_ARCH)" ;
493}
494
495
496# libsolv
497if [ IsPackageAvailable libsolv_devel ] {
498	ExtractBuildFeatureArchives libsolv :
499		file: base libsolv
500			runtime: lib
501		file: devel libsolv_devel
502			depends: base
503			libraries:
504				$(developLibDir)/libsolv.so
505				$(developLibDir)/libsolvext.so
506			headers: $(developHeadersDir)
507		# sources are required for the primary architecture only
508		primary @{
509			file: source libsolv_source
510				sources: develop/sources/%portRevisionedName%/sources
511		}@
512		;
513
514	EnableBuildFeatures libsolv ;
515} else {
516	Echo "libsolv package not available for $(TARGET_PACKAGING_ARCH)" ;
517}
518
519
520# qrencode
521if [ IsPackageAvailable qrencode_kdl_devel ] {
522	ExtractBuildFeatureArchives libqrencode_kdl :
523		file: devel qrencode_kdl_devel
524			library: $(developLibDir)/libqrencode_kdl.a
525			headers: $(developHeadersDir)
526		;
527
528	EnableBuildFeatures libqrencode_kdl ;
529} else {
530	Echo "qrencode support not available on $(TARGET_PACKAGING_ARCH)" ;
531}
532
533
534# tiff
535if [ IsPackageAvailable tiff4_devel ] {
536	ExtractBuildFeatureArchives tiff :
537		file: base tiff4
538			runtime: lib
539		file: devel tiff4_devel
540			depends: base
541			library: $(developLibDir)/libtiff.so.5
542			headers: $(developHeadersDir) $(developHeadersDir)/tiff
543		;
544
545	EnableBuildFeatures tiff ;
546} else {
547	Echo "Tiff support not available on $(TARGET_PACKAGING_ARCH)" ;
548}
549
550
551# openexr
552if [ IsPackageAvailable openexr_devel ]
553	&& [ IsPackageAvailable ilmbase_devel ] {
554	ExtractBuildFeatureArchives openexr :
555		file: base openexr
556			runtime: lib
557		file: devel openexr_devel
558			depends: base
559			libraries:
560				$(developLibDir)/libIlmImf.so
561				$(developLibDir)/libIlmImfUtil.so
562			headers: $(developHeadersDir) $(developHeadersDir)/OpenEXR
563		;
564
565	EnableBuildFeatures openexr ;
566} else {
567	Echo "OpenEXR support not available on $(TARGET_PACKAGING_ARCH)" ;
568}
569
570
571# ilmbase
572if [ IsPackageAvailable ilmbase_devel ] {
573	ExtractBuildFeatureArchives ilmbase :
574		file: base ilmbase
575			runtime: lib
576		file: devel ilmbase_devel
577			depends: base
578			libraries:
579				$(developLibDir)/libHalf.so
580				$(developLibDir)/libIex.so
581				$(developLibDir)/libIexMath.so
582				$(developLibDir)/libIlmThread.so
583				$(developLibDir)/libImath.so
584			headers: $(developHeadersDir) $(developHeadersDir)/OpenEXR
585		;
586
587	EnableBuildFeatures ilmbase ;
588} else {
589	Echo "IlmBase support not available on $(TARGET_PACKAGING_ARCH)" ;
590}
591
592
593# libwebp
594if [ IsPackageAvailable libwebp_devel ] {
595	if $(HAIKU_PACKAGING_ARCH) = x86 && $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
596		ExtractBuildFeatureArchives libwebp :
597			file: base libwebp
598				runtime: lib
599			file: devel libwebp_devel
600				depends: base
601				library: $(developLibDir)/libwebp.so.6
602				headers: $(developHeadersDir) $(developHeadersDir)/webp
603			;
604	} else {
605		ExtractBuildFeatureArchives libwebp :
606			file: base libwebp
607				runtime: lib
608			file: devel libwebp_devel
609				depends: base
610				library: $(developLibDir)/libwebp.so.7
611				headers: $(developHeadersDir) $(developHeadersDir)/webp
612			;
613	}
614
615	EnableBuildFeatures libwebp ;
616} else {
617	Echo "Libwebp support not available on $(TARGET_PACKAGING_ARCH)" ;
618}
619
620
621# live555
622if [ IsPackageAvailable live555_devel ] {
623	ExtractBuildFeatureArchives live555 :
624		file: devel live555_devel
625			libraries:
626				$(developLibDir)/libliveMedia.a
627				$(developLibDir)/libBasicUsageEnvironment.a
628				$(developLibDir)/libgroupsock.a
629				$(developLibDir)/libUsageEnvironment.a
630
631			headers: $(developHeadersDir)
632				$(developHeadersDir)/liveMedia
633				$(developHeadersDir)/BasicUsageEnvironment
634				$(developHeadersDir)/groupsock
635				$(developHeadersDir)/UsageEnvironment
636		;
637	EnableBuildFeatures live555 ;
638} else {
639	Echo "live555 not available for $(TARGET_PACKAGING_ARCH)" ;
640}
641
642
643# ncurses
644if [ IsPackageAvailable ncurses6_devel ] {
645	ExtractBuildFeatureArchives ncurses :
646		file: base ncurses6
647			runtime: lib
648		file: devel ncurses6_devel
649			depends: base
650			library: $(developLibDir)/libncurses.so.6
651			headers: $(developHeadersDir)
652		;
653
654	EnableBuildFeatures ncurses ;
655} else {
656	Echo "ncurses support not available on $(TARGET_PACKAGING_ARCH)" ;
657}
658
659
660# expat
661if [ IsPackageAvailable expat_devel ] {
662	ExtractBuildFeatureArchives expat :
663		file: base expat
664			runtime: lib
665		file: devel expat_devel
666			depends: base
667			library: $(developLibDir)/libexpat.so.1
668			headers: $(developHeadersDir)
669		;
670
671	EnableBuildFeatures expat ;
672} else {
673	Echo "expat support not available on $(TARGET_PACKAGING_ARCH)" ;
674}
675
676
677# gnu-efi
678if [ IsPackageAvailable gnu_efi_kernel ] {
679	ExtractBuildFeatureArchives gnuefi :
680		file: base gnu_efi_kernel
681			headers: develop/headers/gnuefi
682			headersProtocol: develop/headers/gnuefi/protocol
683			headersArch: develop/headers/gnuefi/$(TARGET_ARCH)
684			libdir: develop/lib/gnuefi
685		;
686
687	EnableBuildFeatures gnuefi ;
688} else {
689	Echo "gnu_efi_kernel support not available on $(TARGET_PACKAGING_ARCH)" ;
690}
691
692
693# zstd
694if [ IsPackageAvailable zstd_devel ] {
695	ExtractBuildFeatureArchives zstd :
696		file: base zstd
697			runtime: lib
698		file: devel zstd_devel
699			depends: base
700			library: $(developLibDir)/libzstd.so
701			headers: $(developHeadersDir)
702		# sources are required for the primary architecture only
703		primary @{
704			file: source zstd_source
705				sources: develop/sources/%portRevisionedName%/sources
706		}@
707		;
708
709	EnableBuildFeatures zstd ;
710} else {
711	Echo "zstd support not available on $(TARGET_PACKAGING_ARCH)" ;
712}
713
714
715# ATA Drivers + Bus
716EnableBuildFeatures ata ;
717