From 82c90f2f6b17fd0f0c142b945fb58dd3cfa86a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Buchm=C3=BCller?= Date: Thu, 30 Jan 2020 15:49:52 +0100 Subject: [PATCH] apr: fix cross --- srcpkgs/apr/template | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/srcpkgs/apr/template b/srcpkgs/apr/template index 07532f03751..ce2a87f1265 100644 --- a/srcpkgs/apr/template +++ b/srcpkgs/apr/template @@ -11,15 +11,17 @@ license="Apache-2.0" homepage="http://apr.apache.org/" distfiles="http://www.apache.org/dist/apr/apr-${version}.tar.bz2" checksum=e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea -nocross="mutex_proc_pthread_methods undeclared, configure args need to be fixed" # Do not redefine struct iovec in include/apr_want.h CFLAGS="-DAPR_IOVEC_DEFINED=1" # Can't run test programs when cross compiling if [ "$CROSS_BUILD" ]; then + configure_args+=" apr_cv_pthreads_cflags=-pthread" configure_args+=" apr_cv_process_shared_works=yes" configure_args+=" apr_cv_mutex_robust_shared=yes" + configure_args+=" apr_cv_tcp_nodelay_with_cork=yes" + configure_args+=" ac_cv_func_sem_open=sem_open" fi case "$XBPS_TARGET_MACHINE" in @@ -32,7 +34,13 @@ esac pre_build() { if [ "$CROSS_BUILD" ]; then - sed -i "/LINK_PROG.*OBJECTS_gen_test_char/s|.*|\t${BUILD_CC} ${BUILD_CFLAGS} tools/gen_test_char.c -o tools/gen_test_char|" Makefile + vsed -i Makefile \ + -e "/LINK_PROG.*OBJECTS_gen_test_char/s|.*|\t${BUILD_CC} ${BUILD_CFLAGS} tools/gen_test_char.c -o tools/gen_test_char|" + # Fixup some not detected configure results to match native builds + vsed -i include/apr.h \ + -e "/#define APR_HAVE_SHMEM_MMAP_ZERO/s;0;1;" \ + -e "/#define APR_HAS_POSIXSEM_SERIALIZE/s;0;1;" \ + -e "/#define APR_HAS_PROC_PTHREAD_SERIALIZE/s;0;1;" fi }