diff options
author | peter <peter@FreeBSD.org> | 2014-05-27 07:15:14 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2014-05-27 07:15:14 +0000 |
commit | 073d039ce1755179ade6d76571f16045ade34213 (patch) | |
tree | 0e023fb89b7a7e9a4fa11cfb7d9118a7510d2640 /contrib/apr/configure.in | |
parent | c5be37fb1f34d0c40f8f70140824b785f414c4da (diff) | |
parent | ca02a2bfd2f08739388e00fb3bbe93fa3fa5efb0 (diff) | |
download | FreeBSD-src-073d039ce1755179ade6d76571f16045ade34213.zip FreeBSD-src-073d039ce1755179ade6d76571f16045ade34213.tar.gz |
Merge apr-1.4.8 -> apr-1.5.1 and update.
Diffstat (limited to 'contrib/apr/configure.in')
-rw-r--r-- | contrib/apr/configure.in | 178 |
1 files changed, 102 insertions, 76 deletions
diff --git a/contrib/apr/configure.in b/contrib/apr/configure.in index 655de8d..2a37a30 100644 --- a/contrib/apr/configure.in +++ b/contrib/apr/configure.in @@ -35,7 +35,7 @@ AH_TOP([ dnl Hard-coded inclusion at the tail end of apr_private.h: AH_BOTTOM([ /* switch this on if we have a BeOS version below BONE */ -#if BEOS && !HAVE_BONE_VERSION +#if defined(BEOS) && !defined(HAVE_BONE_VERSION) #define BEOS_R5 1 #else #define BEOS_BONE 1 @@ -282,7 +282,7 @@ AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -o $@ -c $< && touch $@' LT_VERSION="-version-info `$get_version libtool $version_hdr APR`" - link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(LT_LDFLAGS) \$(COMPILE) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" + link="\$(LIBTOOL) \$(LTFLAGS) --mode=link \$(COMPILE) \$(LT_LDFLAGS) \$(LT_VERSION) \$(ALL_LDFLAGS) -o \$@" so_ext='lo' lib_target='-rpath $(libdir) $(OBJECTS)' export_lib_target='-rpath \$(libdir) \$(OBJECTS)' @@ -298,6 +298,9 @@ case $host in *-solaris2*) apr_platform_runtime_link_flag="-R" ;; + *-mingw* | *-cygwin*) + LT_LDFLAGS="$LT_LDFLAGS -no-undefined" + ;; *) ;; esac @@ -432,6 +435,18 @@ case "$host:$CC" in APR_SETVAR(CC,mwcc) APR_SETVAR(AR,ar) ;; + dnl If building static APR, both the APR build and the app build + dnl need -DAPR_DECLARE_STATIC to generate the right linkage from + dnl APR_DECLARE et al. + dnl If building dynamic APR, the APR build needs APR_DECLARE_EXPORT + dnl and the app build should have neither define. + *-mingw* | *-cygwin*) + if test "$enable_shared" = "yes"; then + APR_ADDTO(INTERNAL_CPPFLAGS, -DAPR_DECLARE_EXPORT) + else + APR_ADDTO(CPPFLAGS, -DAPR_DECLARE_STATIC) + fi + ;; esac AC_CACHE_CHECK([whether the compiler provides atomic builtins], [ap_cv_atomic_builtins], @@ -649,7 +664,15 @@ case $host in fi ;; *linux*) - os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` + os_major=[`uname -r | sed -e 's/\([1-9][0-9]*\)\..*/\1/'`] + os_minor=[`uname -r | sed -e 's/[1-9][0-9]*\.\([0-9]\+\)\..*/\1/'`] + if test $os_major -lt 2 -o \( $os_major -eq 2 -a $os_minor -lt 4 \); then + AC_MSG_WARN([Configured for pre-2.4 Linux $os_major.$os_minor]) + os_pre24linux=1 + else + os_pre24linux=0 + AC_MSG_NOTICE([Configured for Linux $os_major.$os_minor]) + fi ;; *os390) os_version=`uname -r | sed -e 's/\.//g'` @@ -872,78 +895,47 @@ if test "$apr_cv_dup3" = "yes"; then AC_DEFINE([HAVE_DUP3], 1, [Define if dup3 function is supported]) fi -# test for accept4 +# Test for accept4(). Create a non-blocking socket, bind it to +# an unspecified port & address (kernel picks), and attempt to +# call accept4() on it. If the syscall is wired up (i.e. the +# kernel is new enough), it should return EAGAIN. AC_CACHE_CHECK([for accept4 support], [apr_cv_accept4], [AC_TRY_RUN([ -#include <unistd.h> #include <sys/types.h> #include <sys/socket.h> -#include <sys/un.h> #include <sys/wait.h> -#include <signal.h> +#include <netinet/in.h> +#include <netinet/tcp.h> #include <errno.h> +#include <string.h> +#include <unistd.h> +#include <fcntl.h> -#define A4_SOCK "./apr_accept4_test_socket" - -int main() +int main(int argc, char **argv) { - pid_t pid; - int fd; - struct sockaddr_un loc, rem; - socklen_t rem_sz; - - if ((pid = fork())) { - int status; + int fd, flags; + struct sockaddr_in sin; - unlink(A4_SOCK); - - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - goto cleanup_failure2; - - loc.sun_family = AF_UNIX; - strncpy(loc.sun_path, A4_SOCK, sizeof(loc.sun_path) - 1); - - if (bind(fd, (struct sockaddr *) &loc, - sizeof(struct sockaddr_un)) == -1) - goto cleanup_failure; - - if (listen(fd, 5) == -1) - goto cleanup_failure; - - rem_sz = sizeof(struct sockaddr_un); - if (accept4(fd, (struct sockaddr *) &rem, &rem_sz, 0) == -1) { - goto cleanup_failure; - } - else { - close(fd); - waitpid(pid, &status, 0); - unlink(A4_SOCK); - return 0; - } - -cleanup_failure: - close(fd); -cleanup_failure2: - kill(pid, SIGKILL); - waitpid(pid, &status, 0); - unlink(A4_SOCK); + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) return 1; - } - else { - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) - return 1; /* this will be bad: we'll hang */ - - loc.sun_family = AF_UNIX; - strncpy(loc.sun_path, A4_SOCK, sizeof(loc.sun_path) - 1); + flags = fcntl(fd, F_GETFL); + if (flags == -1 || fcntl(fd, F_SETFL, flags|O_NONBLOCK) == -1) + return 5; - while(connect(fd, (struct sockaddr *) &loc, - sizeof(struct sockaddr_un)) == -1 && - (errno==ENOENT || errno==ECONNREFUSED)) - ; + memset(&sin, 0, sizeof sin); + sin.sin_family = AF_INET; + + if (bind(fd, (struct sockaddr *) &sin, sizeof sin) == -1) + return 2; + + if (listen(fd, 5) == -1) + return 3; - close(fd); + if (accept4(fd, NULL, 0, SOCK_NONBLOCK) == 0 + || errno == EAGAIN || errno == EWOULDBLOCK) return 0; - } + + return 4; }], [apr_cv_accept4=yes], [apr_cv_accept4=no], [apr_cv_accept4=no])]) if test "$apr_cv_accept4" = "yes"; then @@ -983,6 +975,25 @@ if test "$apr_cv_epoll_create1" = "yes"; then AC_DEFINE([HAVE_EPOLL_CREATE1], 1, [Define if epoll_create1 function is supported]) fi +# Check for z/OS async i/o support. +AC_CACHE_CHECK([for asio -> message queue support], [apr_cv_aio_msgq], +[AC_TRY_RUN([ +#define _AIO_OS390 +#include <aio.h> + +int main() +{ + struct aiocb a; + + a.aio_notifytype = AIO_MSGQ; /* use IPC message queue for notification */ + + return aio_cancel(2, NULL) == -1; +}], [apr_cv_aio_msgq=yes], [apr_cv_aio_msgq=no], [apr_cv_aio_msgq=no])]) + +if test "$apr_cv_aio_msgq" = "yes"; then + AC_DEFINE([HAVE_AIO_MSGQ], 1, [Define if async i/o supports message q's]) +fi + # test for dup3 AC_CACHE_CHECK([for dup3 support], [apr_cv_dup3], [AC_TRY_RUN([ @@ -1180,7 +1191,8 @@ case $host in # that it has it. # FIXME - find exact 2.3 version that MMANON was fixed in. It is # confirmed fixed in 2.4 series. - if test $os_version -le "240"; then + if test $os_pre24linux -eq 1; then + AC_MSG_WARN([Disabling anon mmap() support for Linux pre-2.4]) APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON) fi ;; @@ -1244,13 +1256,18 @@ APR_IFALLYES(header:os2.h, APR_IFALLYES(header:windows.h, [havewin32shm="1" APR_DECIDE(USE_SHMEM_WIN32, [Windows shared memory])]) +AC_ARG_ENABLE(posix-shm, +[ --enable-posix-shm Use POSIX shared memory (shm_open) if available], +[ +if test "$havemmapshm" = "1"; then + APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_SHM) +fi +]) case $host in *linux* ) - # Linux has problems with MM_SHMT_MMANON even though it reports - # that it has it. - # FIXME - find exact 2.3 version that MMANON was fixed in. It is - # confirmed fixed in 2.4 series. - if test $os_version -le "240"; then + # Linux pre-2.4 had problems with MM_SHMT_MMANON even though + # it reports that it has it. + if test $os_pre24linux -eq 1; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl USE_SHMEM_SHMGET) fi @@ -1347,7 +1364,8 @@ AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfi ;; s390-*-linux-gnu) # disable sendfile support for 2.2 on S/390 - if test $os_version -lt 240; then + if test $os_pre24linux -eq 1; then + AC_MSG_WARN([Disabled sendfile support for Linux 2.2 on S/390]) sendfile="0" fi ;; @@ -1532,7 +1550,7 @@ if test "$netdbh" = "1"; then fi AC_ARG_ENABLE(allocator-uses-mmap, - [ --enable-allocator-uses-mmap Use mmap in apr_allocator instead of malloc (experimental)], + [ --enable-allocator-uses-mmap Use mmap in apr_allocator instead of malloc ], [ if test "$enableval" = "yes"; then APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, [AC_DEFINE(APR_ALLOCATOR_USES_MMAP, 1, @@ -2726,6 +2744,7 @@ AC_SUBST(NOTEST_INCLUDES) dnl ----------------------------- Construct the files +AC_SUBST(INTERNAL_CPPFLAGS) AC_SUBST(LDLIBS) AC_SUBST(INCLUDES) AC_SUBST(AR) @@ -2735,13 +2754,20 @@ AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) -# Use -no-install to link the test programs on all platforms -# but Darwin, where it would cause the programs to be linked -# against installed versions of libapr instead of those just -# built. +# Use -no-install or -no-fast-install to link the test +# programs on all platforms but Darwin, where it would cause +# the programs to be linked against installed versions of +# libapr instead of those just built. case $host in -*-apple-darwin*) LT_NO_INSTALL="" ;; -*) LT_NO_INSTALL="-no-install" ;; + *-apple-darwin*) + LT_NO_INSTALL="" + ;; + *-mingw*) + LT_NO_INSTALL="-no-fast-install" + ;; + *) + LT_NO_INSTALL="-no-install" + ;; esac AC_SUBST(LT_NO_INSTALL) |