apr: add configure vars and caches

apr's configure script uses lots of AC_TRY_RUNs and when cross-compiling
needs a leg-up. This commit adds more configure variables (and removes
one, too).

Notable changes:

 - apr_cv_use_lfs64=yes is removed (again) after having a discussion
   about it with the musl developers. The conclusion was that
   _LARGEFILE64_SOURCE is a horrible thing that we don't want and should
   avoid (hence the removal of the variable, because defining
   _LARGEFILE64_SOURCE is all it does).
 - ap_cv_atomic_builtins is set to "yes" for 64-bit platforms. If
   anybody is interested in enabling this for other targets feel free to
   send a patch after testing it.
 - configure doesn't add -lpthread to LIBS when cross-compiling. This is
   not a problem for musl but might be for other libcs. This commit adds
   to related variable.
 - configure caches are added (via patches) for strerror and /dev/zero
   mmap tests. The former fixes a warning on musl (where strerror
   returns int instead of a pointer) and the latter is required for
   pthread pshared mutex apr_lock implementation and cannot be detected
   during cross-compile either.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper
2020-02-04 21:39:43 +01:00
parent 0c6d461cc9
commit 86396c6a49
3 changed files with 70 additions and 2 deletions
+15 -2
View File
@@ -44,11 +44,18 @@ CONFIGURE_ARGS += \
$(call autoconf_bool,CONFIG_IPV6,ipv6)
# XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure
# XXX: don't set apr_cv_use_lfs64=yes, see
# https://www.openwall.com/lists/musl/2020/02/03/18
# XXX: the atomic builtins used require 8-byte intrinsics, which are available
# on all 64-bit architectures and some arm as well as x86 32-bit platforms
CONFIGURE_VARS += \
ap_cv_atomic_builtins=$(if $(CONFIG_ARCH_64BIT),yes,no) \
ac_cv_file__dev_zero=yes \
ac_cv_func_pthread_mutexattr_setpshared=yes \
ac_cv_func_sem_open=yes \
ac_cv_func_setpgrp_void=yes \
ac_cv_mmap__dev_zero=yes \
ac_cv_negative_eai=yes \
ac_cv_o_nonblock_inherited=no \
ac_cv_sizeof_struct_iovec=1 \
ac_cv_struct_rlimit=yes \
@@ -56,12 +63,18 @@ CONFIGURE_VARS += \
apr_cv_dup3=yes \
apr_cv_epoll=yes \
apr_cv_epoll_create1=yes \
apr_cv_gai_addrconfig=yes \
apr_cv_mutex_recursive=yes \
apr_cv_mutex_robust_shared=yes \
apr_cv_process_shared_works=yes \
apr_cv_pthreads_lib=-lpthread \
apr_cv_sock_cloexec=yes \
apr_cv_tcp_nodelay_with_cork=yes \
apr_cv_use_lfs64=yes
apr_cv_tcp_nodelay_with_cork=yes
ifeq ($(call qstrip,$(CONFIG_LIBC)),musl)
CONFIGURE_VARS += \
ac_cv_strerror_r_rc_int=yes
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 \