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.

105 lines
3.1 KiB

  1. #
  2. # Copyright (C) 2007-2011 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
  9. PKG_VERSION:=1.7.0
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=@APACHE/apr/
  13. PKG_HASH:=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea
  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
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_FIXUP:=autoreconf
  20. PKG_INSTALL:=1
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/libapr
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. DEPENDS:=+libpthread +librt +libuuid
  26. TITLE:=Apache Portable Runtime Library
  27. URL:=https://apr.apache.org/
  28. endef
  29. CONFIGURE_ARGS += \
  30. --with-devrandom=/dev/urandom \
  31. $(call autoconf_bool,CONFIG_IPV6,ipv6)
  32. # XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure
  33. # XXX: don't set apr_cv_use_lfs64=yes, see
  34. # https://www.openwall.com/lists/musl/2020/02/03/18
  35. # XXX: the atomic builtins used require 8-byte intrinsics, which are available
  36. # on all 64-bit architectures and some arm as well as x86 32-bit platforms
  37. CONFIGURE_VARS += \
  38. ap_cv_atomic_builtins=$(if $(CONFIG_ARCH_64BIT),yes,no) \
  39. ac_cv_file__dev_zero=yes \
  40. ac_cv_func_pthread_mutexattr_setpshared=yes \
  41. ac_cv_func_sem_open=yes \
  42. ac_cv_func_setpgrp_void=yes \
  43. ac_cv_mmap__dev_zero=yes \
  44. ac_cv_negative_eai=yes \
  45. ac_cv_o_nonblock_inherited=no \
  46. ac_cv_sizeof_struct_iovec=1 \
  47. ac_cv_struct_rlimit=yes \
  48. apr_cv_accept4=yes \
  49. apr_cv_dup3=yes \
  50. apr_cv_epoll=yes \
  51. apr_cv_epoll_create1=yes \
  52. apr_cv_gai_addrconfig=yes \
  53. apr_cv_mutex_recursive=yes \
  54. apr_cv_mutex_robust_shared=yes \
  55. apr_cv_process_shared_works=yes \
  56. apr_cv_pthreads_lib=-lpthread \
  57. apr_cv_sock_cloexec=yes \
  58. apr_cv_tcp_nodelay_with_cork=yes
  59. ifeq ($(call qstrip,$(CONFIG_LIBC)),musl)
  60. CONFIGURE_VARS += \
  61. ac_cv_strerror_r_rc_int=yes
  62. endif
  63. define Build/InstallDev
  64. $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 \
  65. $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
  66. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
  67. $(1)/usr/bin
  68. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
  69. $(1)/usr/include/apr-1
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{a,so*} $(1)/usr/lib
  71. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
  72. $(1)/usr/lib/pkgconfig
  73. $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* $(1)/usr/share/build-1
  74. $(SED) '/^prefix=\|^exec_prefix=/s|/usr|$(STAGING_DIR)/usr|' \
  75. $(1)/usr/bin/apr-1-config
  76. $(SED) '/^bindir=/s|/usr|$$$${prefix}|' $(1)/usr/bin/apr-1-config
  77. $(SED) '/^datadir=/s|/usr|$$$${prefix}|' $(1)/usr/bin/apr-1-config
  78. $(SED) '/^datarootdir=/s|/usr|$$$${prefix}|' $(1)/usr/bin/apr-1-config
  79. $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' \
  80. $(1)/usr/share/build-1/apr_rules.mk
  81. $(INSTALL_DIR) $(2)/bin
  82. $(LN) ../../usr/bin/apr-1-config $(2)/bin/apr-1-config
  83. endef
  84. define Package/libapr/install
  85. $(INSTALL_DIR) $(1)/usr/lib
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib
  87. endef
  88. $(eval $(call BuildPackage,libapr))