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