mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
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:
@@ -0,0 +1,30 @@
|
||||
--- a/build/apr_common.m4
|
||||
+++ b/build/apr_common.m4
|
||||
@@ -526,8 +526,9 @@ dnl string.
|
||||
dnl
|
||||
dnl
|
||||
AC_DEFUN([APR_CHECK_STRERROR_R_RC], [
|
||||
-AC_MSG_CHECKING(for type of return code from strerror_r)
|
||||
-AC_TRY_RUN([
|
||||
+AC_CACHE_CHECK([whether return code from strerror_r has type int],
|
||||
+[ac_cv_strerror_r_rc_int],
|
||||
+[AC_TRY_RUN([
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
@@ -543,14 +544,10 @@ main()
|
||||
}], [
|
||||
ac_cv_strerror_r_rc_int=yes ], [
|
||||
ac_cv_strerror_r_rc_int=no ], [
|
||||
- ac_cv_strerror_r_rc_int=no ] )
|
||||
+ ac_cv_strerror_r_rc_int=no ] ) ] )
|
||||
if test "x$ac_cv_strerror_r_rc_int" = xyes; then
|
||||
AC_DEFINE(STRERROR_R_RC_INT, 1, [Define if strerror returns int])
|
||||
- msg="int"
|
||||
-else
|
||||
- msg="pointer"
|
||||
fi
|
||||
-AC_MSG_RESULT([$msg])
|
||||
] )
|
||||
|
||||
dnl
|
||||
@@ -0,0 +1,25 @@
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1191,8 +1191,9 @@ AC_CHECK_FILE(/dev/zero)
|
||||
# Not all systems can mmap /dev/zero (such as HP-UX). Check for that.
|
||||
if test "$ac_cv_func_mmap" = "yes" &&
|
||||
test "$ac_cv_file__dev_zero" = "yes"; then
|
||||
- AC_MSG_CHECKING(for mmap that can map /dev/zero)
|
||||
- AC_TRY_RUN([
|
||||
+ AC_CACHE_CHECK([for mmap that can map /dev/zero],
|
||||
+ [ac_cv_mmap__dev_zero],
|
||||
+ [AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@@ -1215,9 +1216,7 @@ if test "$ac_cv_func_mmap" = "yes" &&
|
||||
return 3;
|
||||
}
|
||||
return 0;
|
||||
- }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
|
||||
-
|
||||
- AC_MSG_RESULT($ac_cv_file__dev_zero)
|
||||
+ }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])])
|
||||
fi
|
||||
|
||||
# Now we determine which one is our anonymous shmem preference.
|
||||
Reference in New Issue
Block a user