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