apr.mk 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. ################################################################################
  2. #
  3. # apr
  4. #
  5. ################################################################################
  6. APR_VERSION = 1.7.2
  7. APR_SOURCE = apr-$(APR_VERSION).tar.bz2
  8. APR_SITE = https://archive.apache.org/dist/apr
  9. APR_LICENSE = Apache-2.0
  10. APR_LICENSE_FILES = LICENSE
  11. APR_CPE_ID_VENDOR = apache
  12. APR_CPE_ID_PRODUCT = portable_runtime
  13. APR_INSTALL_STAGING = YES
  14. # We have a patch touching configure.in and Makefile.in,
  15. # so we need to autoreconf:
  16. APR_AUTORECONF = YES
  17. # 0004-Merge-r1920082-from-1.8.x.patch
  18. APR_IGNORE_CVES += CVE-2023-49582
  19. APR_CONF_OPTS = --disable-sctp
  20. # avoid apr_hints.m4 by setting apr_preload_done=yes and set
  21. # the needed CFLAGS on our own (avoids '-D_REENTRANT' in case
  22. # not supported by toolchain and subsequent configure failure)
  23. APR_CFLAGS = $(TARGET_CFLAGS) -DLINUX -D_GNU_SOURCE
  24. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  25. APR_CFLAGS += -D_REENTRANT
  26. endif
  27. APR_CONF_ENV = \
  28. CC_FOR_BUILD="$(HOSTCC)" \
  29. CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
  30. CFLAGS="$(APR_CFLAGS)" \
  31. ac_cv_file__dev_zero=yes \
  32. ac_cv_mmap__dev_zero=yes \
  33. ac_cv_func_setpgrp_void=yes \
  34. apr_cv_process_shared_works=yes \
  35. apr_cv_mutex_robust_shared=no \
  36. apr_cv_tcp_nodelay_with_cork=yes \
  37. ac_cv_sizeof_struct_iovec=8 \
  38. ac_cv_sizeof_pid_t=4 \
  39. ac_cv_struct_rlimit=yes \
  40. ac_cv_strerror_r_rc_int=$(if $(BR2_TOOLCHAIN_USES_MUSL),yes,no) \
  41. ac_cv_o_nonblock_inherited=no \
  42. apr_cv_mutex_recursive=yes \
  43. apr_cv_epoll=yes \
  44. apr_cv_epoll_create1=yes \
  45. apr_cv_dup3=yes \
  46. apr_cv_sock_cloexec=yes \
  47. apr_cv_accept4=yes \
  48. apr_preload_done=yes
  49. APR_CONFIG_SCRIPTS = apr-1-config
  50. # Doesn't even try to guess when cross compiling
  51. ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
  52. APR_CONF_ENV += apr_cv_pthreads_lib="-lpthread"
  53. endif
  54. # Fix lfs detection when cross compiling
  55. APR_CONF_ENV += apr_cv_use_lfs64=yes
  56. # Use non-portable atomics when available. We have to override
  57. # ap_cv_atomic_builtins because the test used to check for atomic
  58. # builtins uses AC_TRY_RUN, which doesn't work when cross-compiling.
  59. ifeq ($(BR2_TOOLCHAIN_HAS_SYNC_8),y)
  60. APR_CONF_OPTS += --enable-nonportable-atomics
  61. APR_CONF_ENV += ap_cv_atomic_builtins=yes
  62. else
  63. APR_CONF_OPTS += --disable-nonportable-atomics
  64. endif
  65. ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
  66. APR_DEPENDENCIES += util-linux
  67. endif
  68. define APR_CLEANUP_UNNEEDED_FILES
  69. $(RM) -rf $(TARGET_DIR)/usr/build-1/
  70. endef
  71. APR_POST_INSTALL_TARGET_HOOKS += APR_CLEANUP_UNNEEDED_FILES
  72. define APR_FIXUP_RULES_MK
  73. $(SED) 's%apr_builddir=%apr_builddir=$(STAGING_DIR)%' \
  74. $(STAGING_DIR)/usr/build-1/apr_rules.mk
  75. $(SED) 's%apr_builders=%apr_builders=$(STAGING_DIR)%' \
  76. $(STAGING_DIR)/usr/build-1/apr_rules.mk
  77. $(SED) 's%top_builddir=%top_builddir=$(STAGING_DIR)%' \
  78. $(STAGING_DIR)/usr/build-1/apr_rules.mk
  79. endef
  80. APR_POST_INSTALL_STAGING_HOOKS += APR_FIXUP_RULES_MK
  81. $(eval $(autotools-package))