RepositoryRules: RepositoryConfig does not need/use URL now.
[haiku.git] / build / jam / BuildFeatures
blob8b299308aaf798ffba3a9dd7c51731ba82c3c4ba
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).
6 local architecture = $(TARGET_PACKAGING_ARCH) ;
7 local secondaryArchSubDir = [ MultiArchIfPrimary "" : /$(architecture) ] ;
8 local libDir = lib$(secondaryArchSubDir) ;
9 local developLibDir = develop/lib$(secondaryArchSubDir) ;
10 local developHeadersDir = develop/headers$(secondaryArchSubDir) ;
13 # SSL
15 # Automatically enable the SSL feature, when the OpenSSL package is enabled.
16 if [ IsHaikuImagePackageAdded openssl ] {
17         HAIKU_BUILD_FEATURE_SSL = 1 ;
20 if $(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                         ;
33                 EnableBuildFeatures openssl ;
34         } else {
35                 Echo "SSL build feature not available for $(TARGET_PACKAGING_ARCH)" ;
36         }
40 # gcc_syslibs
42 if $(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                         ;
51                 EnableBuildFeatures gcc_syslibs ;
52         } else  {
53                 Echo "gcc_syslibs not available for $(TARGET_PACKAGING_ARCH)" ;
54         }
58 # gcc_syslibs_devel
60 if [ 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         }
87         EnableBuildFeatures gcc_syslibs_devel ;
88 } else  {
89         Echo "gcc_syslibs_devel not available for $(TARGET_PACKAGING_ARCH)" ;
93 # ICU
95 if [ 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                 ;
112         EnableBuildFeatures icu ;
113 } else  {
114         Echo "ICU not available for $(TARGET_PACKAGING_ARCH)" ;
118 # curl
119 if [ 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                 ;
130         EnableBuildFeatures curl ;
131 } else  {
132         Echo "Curl not available for $(TARGET_PACKAGING_ARCH)" ;
136 # CLucene
138 # TODO: Update to packages!
139 if ! 1 {
141 # Automatically install the CLucene feature, when the CLucene package is
142 # enabled.
143 if [ IsHaikuImagePackageAdded clucene ] {
144         HAIKU_BUILD_FEATURE_CLUCENE = 1 ;
148 HAIKU_CLUCENE_PACKAGE = clucene-0.9.21-x86-gcc4-haiku-2009-08-11.zip ;
149 HAIKU_CLUCENE_URL = $(baseURL)/$(HAIKU_CLUCENE_PACKAGE) ;
151 if $(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) ] ;
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) ] ;
165                 # extract headers and libraries
166                 HAIKU_CLUCENE_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_CLUCENE_DIR)
167                         : common/include/ : $(zipFile) : extracted-clucene
168                 ] ;
170                 HAIKU_CLUCENE_LIBS = [ ExtractArchive $(HAIKU_CLUCENE_DIR)
171                         :
172                         common/lib/libclucene.a
173                         : $(zipFile)
174                          : extracted-clucene
175                 ] ;
177                 HAIKU_CLUCENE_HEADERS
178                         = [ FDirName $(HAIKU_CLUCENE_DIR) common include ] ;
180                 EnableBuildFeatures clucene ;
181         }
184 } # ! 1
187 # Giflib
188 if [ 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                 ;
198         EnableBuildFeatures giflib ;
199 } else {
200         Echo "Giflib support not available on $(TARGET_PACKAGING_ARCH)" ;
204 # GLU (GL Utilities)
205 if [ 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                 ;
215         EnableBuildFeatures glu ;
216 } else {
217         Echo "GLU not yet available on $(TARGET_PACKAGING_ARCH)" ;
221 # GL (GL Kit, Mesa3D)
222 if [ 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                 ;
232         EnableBuildFeatures mesa ;
233 } else {
234         Echo "GL not yet available on $(TARGET_PACKAGING_ARCH)" ;
238 # FFmpeg
239 if [ IsPackageAvailable ffmpeg_devel ] {
240         local ffmpegLibs = libavformat.so libavcodec.so libavdevice.so
241                 libavfilter.so libswscale.so libavutil.so libswresample.so ;
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                 ;
252         EnableBuildFeatures ffmpeg ;
254 } else {
255         Echo "FFMpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
259 # Fluidlite
260 if [ IsPackageAvailable fluidlite_devel ] && [ IsPackageAvailable libvorbis_devel ] {
261         ExtractBuildFeatureArchives fluidlite :
262                 file: devel fluidlite_devel
263                         library: $(developLibDir)/libfluidlite.a
264                         headers: $(developHeadersDir)
265                 ;
267         EnableBuildFeatures fluidlite ;
268 } else {
269         Echo "Fluidlite support not available on $(TARGET_PACKAGING_ARCH)" ;
273 # Libvorbis
274 if [ 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                 ;
284         EnableBuildFeatures libvorbis ;
285 } else {
286         Echo "Libvorbis support not available on $(TARGET_PACKAGING_ARCH)" ;
290 # Freetype
291 if [ 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                 ;
301         EnableBuildFeatures freetype ;
302 } else {
303         Echo "Freetype support not available on $(TARGET_PACKAGING_ARCH)" ;
306 # fontconfig
307 if [ IsPackageAvailable fontconfig_devel ] {
308         ExtractBuildFeatureArchives fontconfig :
309                 file: base fontconfig
310                         runtime: lib
311                 file: devel fontconfig_devel
312                         depends: base
313                         library: $(developLibDir)/libfontconfig.so
314                         headers: $(developHeadersDir) $(developHeadersDir)/fontconfig
315                 ;
317         EnableBuildFeatures fontconfig ;
318 } else {
319         Echo "fontconfig support not available on $(TARGET_PACKAGING_ARCH)" ;
322 # Gutenprint
323 if [ IsPackageAvailable gutenprint_devel ] {
324         ExtractBuildFeatureArchives gutenprint :
325                 file: base gutenprint
326                         runtime: lib
327                 file: devel gutenprint_devel
328                         depends: base
329                         library: $(developLibDir)/libgutenprint.so
330                         headers: $(developHeadersDir) $(developHeadersDir)/gutenprint
331                 ;
333         EnableBuildFeatures gutenprint ;
334 } else {
335         Echo "Gutenprint support not available on $(TARGET_PACKAGING_ARCH)" ;
339 # TagLib
341 # TODO: Update to packages!
342 if ! 1 {
344 # Automatically install the TagLib feature, when the optional TagLib optional
345 # package is enabled.
346 if [ IsHaikuImagePackageAdded taglib ] {
347         HAIKU_BUILD_FEATURE_TAGLIB = 1 ;
350 HAIKU_TAGLIB_PACKAGE = taglib-1.6.3-r1a4-x86-gcc2-2012-09-03.zip ;
351 HAIKU_TAGLIB_URL = $(baseURL)/$(HAIKU_TAGLIB_PACKAGE) ;
353 if $(HAIKU_BUILD_FEATURE_TAGLIB) {
354         if $(TARGET_ARCH) != x86 {
355                 Echo "TagLib build feature not available for $(TARGET_PACKAGING_ARCH)" ;
356         } else {
357                 # Download the zip archive.
358                 local zipFile = [ DownloadFile $(HAIKU_TAGLIB_PACKAGE)
359                         : $(HAIKU_TAGLIB_URL) ] ;
361                 # zip file and output directory
362                 HAIKU_TAGLIB_ZIP_FILE = $(zipFile) ;
363                 HAIKU_TAGLIB_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR)
364                         $(HAIKU_TAGLIB_PACKAGE:B) ] ;
366                 # extract headers and libraries
367                 HAIKU_TAGLIB_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
368                         : common/include/ : $(zipFile) : extracted-taglib
369                 ] ;
371                 HAIKU_TAGLIB_LIBS = [ ExtractArchive $(HAIKU_TAGLIB_DIR)
372                         :
373                         common/lib/libtag.so
374                         common/lib/libtag_c.so
375                         : $(zipFile)
376                         : extracted-taglib
377                 ] ;
379                 HAIKU_TAGLIB_HEADERS
380                         = [ FDirName $(HAIKU_TAGLIB_DIR) common include taglib ] ;
382                 EnableBuildFeatures taglib ;
383         }
386 } # ! 1
389 # WebKit
390 if [ IsPackageAvailable haikuwebkit_devel ] {
391         ExtractBuildFeatureArchives webkit :
392                 file: base haikuwebkit
393                         runtime: lib
394                 file: devel haikuwebkit_devel
395                         depends: base
396                         libraries:
397                                 $(developLibDir)/libWebKit.so
398                         headers: $(developHeadersDir)
399                 ;
401         EnableBuildFeatures webkit ;
402 } else {
403         Echo "WebKit build feature not available for $(TARGET_PACKAGING_ARCH)" ;
407 # libpng
408 if [ IsPackageAvailable libpng16_devel ] {
409         ExtractBuildFeatureArchives libpng :
410                 file: base libpng16
411                         runtime: lib
412                 file: devel libpng16_devel
413                         depends: base
414                         library: $(developLibDir)/libpng16.so
415                         headers: $(developHeadersDir)
416                 ;
418         EnableBuildFeatures libpng ;
419 } else {
420         Echo "libpng support not available on $(TARGET_PACKAGING_ARCH)" ;
424 # libicns
425 if [ IsPackageAvailable libicns_devel ] {
426         ExtractBuildFeatureArchives libicns :
427                 file: base libicns
428                         runtime: lib
429                 file: devel libicns_devel
430                         depends: base
431                         library: $(developLibDir)/libicns.so.1
432                         headers: $(developHeadersDir)
433                 ;
435         EnableBuildFeatures libicns ;
436 } else {
437         Echo "libicns support not available on $(TARGET_PACKAGING_ARCH)" ;
441 # Jasper
442 if [ IsPackageAvailable jasper_devel ] {
443         ExtractBuildFeatureArchives jasper :
444                 file: base jasper
445                         runtime: lib
446                 file: devel jasper_devel
447                         depends: base
448                         library: $(developLibDir)/libjasper.so.4
449                         headers: $(developHeadersDir) $(developHeadersDir)/jasper
450                 ;
452         EnableBuildFeatures jasper ;
453 } else {
454         Echo "Jasper support not available on $(TARGET_PACKAGING_ARCH)" ;
458 # jpeg
459 if [ IsPackageAvailable jpeg_devel ] {
460         ExtractBuildFeatureArchives jpeg :
461                 file: base jpeg
462                         runtime: lib
463                 file: devel jpeg_devel
464                         depends: base
465                         library: $(developLibDir)/libjpeg.so
466                         headers: $(developHeadersDir)
467                 ;
469         EnableBuildFeatures jpeg ;
470 } else {
471         Echo "jpeg support not available on $(TARGET_PACKAGING_ARCH)" ;
475 # zlib
476 if [ IsPackageAvailable zlib_devel ] {
477         ExtractBuildFeatureArchives zlib :
478                 file: base zlib
479                         runtime: lib
480                 file: devel zlib_devel
481                         depends: base
482                         library: $(developLibDir)/libz.so
483                         headers: $(developHeadersDir)
484                 # sources are required for the primary architecture only
485                 primary @{
486                         file: source zlib_source
487                                 sources: develop/sources/%portRevisionedName%/sources
488                 }@
489                 ;
491         EnableBuildFeatures zlib ;
492 } else {
493         Echo "zlib support not available on $(TARGET_PACKAGING_ARCH)" ;
497 # libedit
498 if [ IsPackageAvailable libedit_devel ] {
499         ExtractBuildFeatureArchives libedit :
500                 file: base libedit
501                         runtime: lib
502                 file: devel libedit_devel
503                         depends: base
504                         library: $(developLibDir)/libedit.so
505                         headers: $(developHeadersDir)
506                 ;
508         EnableBuildFeatures libedit ;
509 } else {
510         Echo "libedit support not available on $(TARGET_PACKAGING_ARCH)" ;
514 # libsolv
515 if [ IsPackageAvailable libsolv_devel ] {
516         ExtractBuildFeatureArchives libsolv :
517                 file: base libsolv
518                         runtime: lib
519                 file: devel libsolv_devel
520                         depends: base
521                         libraries:
522                                 $(developLibDir)/libsolv.so
523                                 $(developLibDir)/libsolvext.so
524                         headers: $(developHeadersDir)
525                 # sources are required for the primary architecture only
526                 primary @{
527                         file: source libsolv_source
528                                 sources: develop/sources/%portRevisionedName%/sources
529                 }@
530                 ;
532         EnableBuildFeatures libsolv ;
533 } else {
534         Echo "libsolv package not available for $(TARGET_PACKAGING_ARCH)" ;
538 # qrencode
539 if [ IsPackageAvailable qrencode_kdl_devel ] {
540         ExtractBuildFeatureArchives libqrencode_kdl :
541                 file: devel qrencode_kdl_devel
542                         library: $(developLibDir)/libqrencode_kdl.a
543                         headers: $(developHeadersDir)
544                 ;
546         EnableBuildFeatures libqrencode_kdl ;
547 } else {
548         Echo "qrencode support not available on $(TARGET_PACKAGING_ARCH)" ;
552 # tiff
553 if [ IsPackageAvailable tiff4_devel ] {
554         ExtractBuildFeatureArchives tiff :
555                 file: base tiff4
556                         runtime: lib
557                 file: devel tiff4_devel
558                         depends: base
559                         library: $(developLibDir)/libtiff.so.5
560                         headers: $(developHeadersDir) $(developHeadersDir)/tiff
561                 ;
563         EnableBuildFeatures tiff ;
564 } else {
565         Echo "Tiff support not available on $(TARGET_PACKAGING_ARCH)" ;
569 # libwebp
570 if [ IsPackageAvailable libwebp_devel ] {
571         if $(HAIKU_PACKAGING_ARCH) = x86 && $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
572                 ExtractBuildFeatureArchives libwebp :
573                         file: base libwebp
574                                 runtime: lib
575                         file: devel libwebp_devel
576                                 depends: base
577                                 library: $(developLibDir)/libwebp.so.6
578                                 headers: $(developHeadersDir) $(developHeadersDir)/webp
579                         ;
580         } else {
581                 ExtractBuildFeatureArchives libwebp :
582                         file: base libwebp
583                                 runtime: lib
584                         file: devel libwebp_devel
585                                 depends: base
586                                 library: $(developLibDir)/libwebp.so.7
587                                 headers: $(developHeadersDir) $(developHeadersDir)/webp
588                         ;
589         }
591         EnableBuildFeatures libwebp ;
592 } else {
593         Echo "Libwebp support not available on $(TARGET_PACKAGING_ARCH)" ;
597 # live555
598 if [ IsPackageAvailable live555_devel ] {
599         ExtractBuildFeatureArchives live555 :
600                 file: devel live555_devel
601                         libraries:
602                                 $(developLibDir)/libliveMedia.a
603                                 $(developLibDir)/libBasicUsageEnvironment.a
604                                 $(developLibDir)/libgroupsock.a
605                                 $(developLibDir)/libUsageEnvironment.a
607                         headers: $(developHeadersDir)
608                                 $(developHeadersDir)/liveMedia
609                                 $(developHeadersDir)/BasicUsageEnvironment
610                                 $(developHeadersDir)/groupsock
611                                 $(developHeadersDir)/UsageEnvironment
612                 ;
613         EnableBuildFeatures live555 ;
614 } else  {
615         Echo "live555 not available for $(TARGET_PACKAGING_ARCH)" ;
619 # ncurses
620 if [ IsPackageAvailable ncurses6_devel ] {
621         ExtractBuildFeatureArchives ncurses :
622                 file: base ncurses6
623                         runtime: lib
624                 file: devel ncurses6_devel
625                         depends: base
626                         library: $(developLibDir)/libncurses.so.6
627                         headers: $(developHeadersDir)
628                 ;
630         EnableBuildFeatures ncurses ;
631 } else {
632         Echo "ncurses support not available on $(TARGET_PACKAGING_ARCH)" ;
636 # expat
637 if [ IsPackageAvailable expat_devel ] {
638         ExtractBuildFeatureArchives expat :
639                 file: base expat
640                         runtime: lib
641                 file: devel expat_devel
642                         depends: base
643                         library: $(developLibDir)/libexpat.so.1
644                         headers: $(developHeadersDir)
645                 ;
647         EnableBuildFeatures expat ;
648 } else {
649         Echo "expat support not available on $(TARGET_PACKAGING_ARCH)" ;
653 # gnu-efi
654 if $(TARGET_PACKAGING_ARCH) = x86_64 {
655         if [ IsPackageAvailable gnuefi ] {
656                 ExtractBuildFeatureArchives gnuefi :
657                         file: base gnuefi
658                                 headers: $(developHeadersDir)/gnuefi
659                                 headersProtocol: $(developHeadersDir)/gnuefi/protocol
660                                 headersArch: $(developHeadersDir)/gnuefi/$(TARGET_ARCH)
661                                 libdir: $(libDir)/gnuefi
662                         ;
664                 EnableBuildFeatures gnuefi ;
665         } else {
666                 Echo "gnuefi support not available on $(TARGET_PACKAGING_ARCH)" ;
667         }
671 # zstd
672 if [ IsPackageAvailable zstd_devel ] {
673         ExtractBuildFeatureArchives zstd :
674                 file: base zstd
675                         runtime: lib
676                 file: devel zstd_devel
677                         depends: base
678                         library: $(developLibDir)/libzstd.so
679                         headers: $(developHeadersDir)
680                 # sources are required for the primary architecture only
681                 primary @{
682                         file: source zstd_source
683                                 sources: develop/sources/%portRevisionedName%/sources
684                 }@
685                 ;
687         EnableBuildFeatures zstd ;
688 } else {
689         Echo "zstd support not available on $(TARGET_PACKAGING_ARCH)" ;
693 # ATA Drivers + Bus
694 EnableBuildFeatures ata ;