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.

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