libarchive.mk 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. ################################################################################
  2. #
  3. # libarchive
  4. #
  5. ################################################################################
  6. LIBARCHIVE_VERSION = 3.7.7
  7. LIBARCHIVE_SOURCE = libarchive-$(LIBARCHIVE_VERSION).tar.xz
  8. LIBARCHIVE_SITE = https://www.libarchive.de/downloads
  9. LIBARCHIVE_INSTALL_STAGING = YES
  10. LIBARCHIVE_LICENSE = BSD-2-Clause, BSD-3-Clause, CC0-1.0, OpenSSL, Apache-2.0
  11. LIBARCHIVE_LICENSE_FILES = COPYING
  12. LIBARCHIVE_CPE_ID_VENDOR = libarchive
  13. # We're patching configure.ac
  14. LIBARCHIVE_AUTORECONF = YES
  15. # needed for autoreconf
  16. LIBARCHIVE_DEPENDENCIES += host-pkgconf
  17. ifeq ($(BR2_PACKAGE_LIBARCHIVE_BSDTAR),y)
  18. ifeq ($(BR2_STATIC_LIBS),y)
  19. LIBARCHIVE_CONF_OPTS += --enable-bsdtar=static
  20. else
  21. LIBARCHIVE_CONF_OPTS += --enable-bsdtar=shared
  22. endif
  23. else
  24. LIBARCHIVE_CONF_OPTS += --disable-bsdtar
  25. endif
  26. ifeq ($(BR2_PACKAGE_LIBARCHIVE_BSDCPIO),y)
  27. ifeq ($(BR2_STATIC_LIBS),y)
  28. LIBARCHIVE_CONF_OPTS += --enable-bsdcpio=static
  29. else
  30. LIBARCHIVE_CONF_OPTS += --enable-bsdcpio=shared
  31. endif
  32. else
  33. LIBARCHIVE_CONF_OPTS += --disable-bsdcpio
  34. endif
  35. ifeq ($(BR2_PACKAGE_LIBARCHIVE_BSDCAT),y)
  36. ifeq ($(BR2_STATIC_LIBS),y)
  37. LIBARCHIVE_CONF_OPTS += --enable-bsdcat=static
  38. else
  39. LIBARCHIVE_CONF_OPTS += --enable-bsdcat=shared
  40. endif
  41. else
  42. LIBARCHIVE_CONF_OPTS += --disable-bsdcat
  43. endif
  44. ifeq ($(BR2_PACKAGE_LIBARCHIVE_BSDUNZIP),y)
  45. ifeq ($(BR2_STATIC_LIBS),y)
  46. LIBARCHIVE_CONF_OPTS += --enable-bsdunzip=static
  47. else
  48. LIBARCHIVE_CONF_OPTS += --enable-bsdunzip=shared
  49. endif
  50. else
  51. LIBARCHIVE_CONF_OPTS += --disable-bsdunzip
  52. endif
  53. ifeq ($(BR2_PACKAGE_ACL),y)
  54. LIBARCHIVE_DEPENDENCIES += acl
  55. else
  56. LIBARCHIVE_CONF_OPTS += --disable-acl
  57. endif
  58. ifeq ($(BR2_PACKAGE_ATTR),y)
  59. LIBARCHIVE_DEPENDENCIES += attr
  60. else
  61. LIBARCHIVE_CONF_OPTS += --disable-xattr
  62. endif
  63. ifeq ($(BR2_PACKAGE_BZIP2),y)
  64. LIBARCHIVE_CONF_OPTS += --with-bz2lib
  65. LIBARCHIVE_DEPENDENCIES += bzip2
  66. else
  67. LIBARCHIVE_CONF_OPTS += --without-bz2lib
  68. endif
  69. ifeq ($(BR2_PACKAGE_EXPAT),y)
  70. LIBARCHIVE_DEPENDENCIES += expat
  71. else
  72. LIBARCHIVE_CONF_OPTS += --without-expat
  73. endif
  74. ifeq ($(BR2_PACKAGE_LIBICONV),y)
  75. LIBARCHIVE_DEPENDENCIES += libiconv
  76. else
  77. LIBARCHIVE_CONF_OPTS += --without-libiconv-prefix
  78. endif
  79. ifeq ($(BR2_PACKAGE_LIBXML2),y)
  80. LIBARCHIVE_DEPENDENCIES += libxml2
  81. LIBARCHIVE_CONF_ENV += XML2_CONFIG=$(STAGING_DIR)/usr/bin/xml2-config
  82. else
  83. LIBARCHIVE_CONF_OPTS += --without-xml2
  84. endif
  85. ifeq ($(BR2_PACKAGE_LZ4),y)
  86. LIBARCHIVE_CONF_OPTS += --with-lz4
  87. LIBARCHIVE_DEPENDENCIES += lz4
  88. else
  89. LIBARCHIVE_CONF_OPTS += --without-lz4
  90. endif
  91. ifeq ($(BR2_PACKAGE_LZO),y)
  92. LIBARCHIVE_DEPENDENCIES += lzo
  93. else
  94. LIBARCHIVE_CONF_OPTS += --without-lzo2
  95. endif
  96. ifeq ($(BR2_PACKAGE_MBEDTLS),y)
  97. LIBARCHIVE_DEPENDENCIES += mbedtls
  98. LIBARCHIVE_CONF_OPTS += --with-mbedtls
  99. else
  100. LIBARCHIVE_CONF_OPTS += --without-mbedtls
  101. endif
  102. ifeq ($(BR2_PACKAGE_NETTLE),y)
  103. LIBARCHIVE_DEPENDENCIES += nettle
  104. LIBARCHIVE_CONF_OPTS += --with-nettle
  105. else
  106. LIBARCHIVE_CONF_OPTS += --without-nettle
  107. endif
  108. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  109. LIBARCHIVE_DEPENDENCIES += openssl
  110. else
  111. LIBARCHIVE_CONF_OPTS += --without-openssl
  112. endif
  113. ifeq ($(BR2_PACKAGE_ZLIB),y)
  114. LIBARCHIVE_DEPENDENCIES += zlib
  115. else
  116. LIBARCHIVE_CONF_OPTS += --without-zlib
  117. endif
  118. # libarchive requires LZMA with thread support in the toolchain
  119. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS)$(BR2_PACKAGE_XZ),yy)
  120. LIBARCHIVE_DEPENDENCIES += xz
  121. LIBARCHIVE_CONF_OPTS += --with-lzma
  122. else
  123. LIBARCHIVE_CONF_OPTS += --without-lzma
  124. endif
  125. ifeq ($(BR2_PACKAGE_ZSTD),y)
  126. LIBARCHIVE_DEPENDENCIES += zstd
  127. LIBARCHIVE_CONF_OPTS += --with-zstd
  128. else
  129. LIBARCHIVE_CONF_OPTS += --without-zstd
  130. endif
  131. # The only user of host-libarchive needs zlib support
  132. HOST_LIBARCHIVE_DEPENDENCIES = host-zlib
  133. # needed for autoreconf
  134. HOST_LIBARCHIVE_DEPENDENCIES += host-pkgconf
  135. HOST_LIBARCHIVE_CONF_OPTS = \
  136. --disable-bsdtar \
  137. --disable-bsdcpio \
  138. --disable-bsdcat \
  139. --disable-acl \
  140. --disable-xattr \
  141. --without-bz2lib \
  142. --without-expat \
  143. --without-libiconv-prefix \
  144. --without-xml2 \
  145. --without-lz4 \
  146. --without-lzo2 \
  147. --without-mbedtls \
  148. --without-nettle \
  149. --without-openssl \
  150. --without-lzma \
  151. --without-zstd
  152. $(eval $(autotools-package))
  153. $(eval $(host-autotools-package))