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