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