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