You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
4.8 KiB

  1. #
  2. # Copyright (C) 2007-2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=apr-util
  9. PKG_VERSION:=1.6.1
  10. PKG_RELEASE:=6
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=@APACHE/apr/
  13. PKG_HASH:=d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b
  14. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
  15. Sebastian Kemper <sebastian_ml@gmx.net>
  16. PKG_LICENSE:=Apache-2.0
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:apache:apr-util
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_CONFIG_DEPENDS := \
  21. CONFIG_PACKAGE_libaprutil-crypto-openssl \
  22. CONFIG_PACKAGE_libaprutil-dbd-mysql \
  23. CONFIG_PACKAGE_libaprutil-dbd-odbc \
  24. CONFIG_PACKAGE_libaprutil-dbd-pgsql \
  25. CONFIG_PACKAGE_libaprutil-dbd-sqlite3 \
  26. CONFIG_PACKAGE_libaprutil-dbm-gdbm \
  27. CONFIG_PACKAGE_libaprutil-ldap
  28. PKG_FIXUP:=autoreconf
  29. PKG_INSTALL:=1
  30. include $(INCLUDE_DIR)/package.mk
  31. include $(INCLUDE_DIR)/nls.mk
  32. define Package/libaprutil/Default
  33. SECTION:=libs
  34. CATEGORY:=Libraries
  35. URL:=http://apr.apache.org/
  36. endef
  37. define Package/libaprutil
  38. $(call Package/libaprutil/Default)
  39. DEPENDS:=+libapr +libexpat +libuuid $(ICONV_DEPENDS)
  40. TITLE:=Apache Portable Runtime Utility Library
  41. endef
  42. CONFIGURE_ARGS += \
  43. --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
  44. --with-expat="$(STAGING_DIR)/usr" \
  45. --with-iconv="$(ICONV_PREFIX)" \
  46. --without-sqlite2
  47. ifneq ($(CONFIG_PACKAGE_libaprutil-crypto-openssl),)
  48. CONFIGURE_ARGS += --with-crypto --with-openssl="$(STAGING_DIR)/usr"
  49. else
  50. CONFIGURE_ARGS += --without-crypto
  51. endif
  52. ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-mysql),)
  53. CONFIGURE_ARGS += --with-mysql="$(STAGING_DIR)/usr"
  54. else
  55. CONFIGURE_ARGS += --without-mysql
  56. endif
  57. ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-odbc),)
  58. CONFIGURE_ARGS += --with-odbc="$(STAGING_DIR)/usr"
  59. else
  60. CONFIGURE_ARGS += --without-odbc
  61. endif
  62. ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-pgsql),)
  63. CONFIGURE_ARGS += --with-pgsql="$(STAGING_DIR)/usr"
  64. else
  65. CONFIGURE_ARGS += --without-pgsql
  66. endif
  67. ifneq ($(CONFIG_PACKAGE_libaprutil-dbd-sqlite3),)
  68. CONFIGURE_ARGS += --with-sqlite3="$(STAGING_DIR)/usr"
  69. else
  70. CONFIGURE_ARGS += --without-sqlite3
  71. endif
  72. ifneq ($(CONFIG_PACKAGE_libaprutil-dbm-gdbm),)
  73. CONFIGURE_ARGS += --with-gdbm="$(STAGING_DIR)/usr"
  74. else
  75. CONFIGURE_ARGS += --without-gdbm
  76. endif
  77. ifneq ($(CONFIG_PACKAGE_libaprutil-ldap),)
  78. CONFIGURE_ARGS += \
  79. --with-ldap \
  80. --with-ldap-include="$(STAGING_DIR)/usr/include" \
  81. --with-ldap-lib="$(STAGING_DIR)/usr/lib"
  82. else
  83. CONFIGURE_ARGS += \
  84. --without-ldap
  85. endif
  86. CONFIGURE_VARS += \
  87. ac_cv_path_ODBC_CONFIG= \
  88. apu_cv_weak_symbols=yes \
  89. APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1"
  90. ifeq ($(CONFIG_USE_GLIBC)$(CONFIG_USE_MUSL),y)
  91. CONFIGURE_VARS += \
  92. apu_cv_explicit_bzero=yes
  93. endif
  94. define Package/libaprutil/install/driver
  95. $(INSTALL_DIR) $(1)/usr/lib/apr-util-1
  96. $(CP) $(PKG_INSTALL_DIR)/usr/lib/apr-util-1/apr_$(2)*.so \
  97. $(1)/usr/lib/apr-util-1
  98. endef
  99. define Package/libaprutil/Driver
  100. define Package/libaprutil-$(subst _,-,$(1))
  101. $(call Package/libaprutil/Default)
  102. TITLE:=libaprutil - $(2) driver
  103. DEPENDS:=libaprutil $(patsubst +%,+PACKAGE_libaprutil-$(subst _,-,$(1)):%,$(3))
  104. endef
  105. define Package/libaprutil-$(subst _,-,$(1))/install
  106. $(foreach d,$(1),$(call Package/libaprutil/install/driver,$$(1),$(d));)
  107. endef
  108. $$(eval $$(call BuildPackage,libaprutil-$(subst _,-,$(1))))
  109. endef
  110. # PKG_CONFIG_DEPENDS trigger configure, but the compile afterward may be
  111. # incomplete if the build directory is not cleaned before. This is not a
  112. # general observation, yet it is valid for apr-util :/
  113. define Build/Compile
  114. $(call Build/Compile/Default,clean all)
  115. endef
  116. define Build/InstallDev
  117. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 \
  118. $(1)/usr/lib/apr-util-1 $(1)/usr/lib/pkgconfig
  119. $(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config $(1)/usr/bin
  120. $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* $(1)/usr/include/apr-1
  121. $(CP) $(PKG_INSTALL_DIR)/usr/lib/apr-util-1/apr_*.{a,so} \
  122. $(1)/usr/lib/apr-util-1 2>/dev/null || :
  123. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{a,so*} \
  124. $(1)/usr/lib
  125. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \
  126. $(1)/usr/lib/pkgconfig
  127. $(SED) '/^prefix=\|^exec_prefix=/s|/usr|$(STAGING_DIR)/usr|' \
  128. $(1)/usr/bin/apu-1-config
  129. endef
  130. define Package/libaprutil/install
  131. $(INSTALL_DIR) $(1)/usr/lib
  132. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib
  133. endef
  134. $(eval $(call BuildPackage,libaprutil))
  135. $(eval $(call Package/libaprutil/Driver,crypto_openssl,OpenSSL,+libopenssl))
  136. $(eval $(call Package/libaprutil/Driver,dbd_mysql,MySQL,+libmariadb))
  137. $(eval $(call Package/libaprutil/Driver,dbd_odbc,ODBC,+unixodbc))
  138. $(eval $(call Package/libaprutil/Driver,dbd_pgsql,PostgreSQL,+libpq))
  139. $(eval $(call Package/libaprutil/Driver,dbd_sqlite3,SQLite3,+libsqlite3))
  140. $(eval $(call Package/libaprutil/Driver,dbm_gdbm,GDBM dbm,+libgdbm))
  141. $(eval $(call Package/libaprutil/Driver,ldap,LDAP,+libopenldap))