apr.mk 2.5 KB

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