dnl # dnl # Autoconf configuration file for APR dnl # dnl # Process this file with autoconf to produce a configure script. dnl # Use ./buildconf to prepare build files and run autoconf for APR. AC_INIT(build/apr_common.m4) AC_CONFIG_HEADER(include/arch/unix/apr_private.h) AC_CONFIG_AUX_DIR(build) dnl # dnl # Include our own M4 macros along with those for libtool dnl # sinclude(build/apr_common.m4) sinclude(build/apr_network.m4) sinclude(build/apr_threads.m4) sinclude(build/apr_hints.m4) sinclude(build/libtool.m4) dnl Save user-defined environment settings for later restoration dnl APR_SAVE_THE_ENVIRONMENT(CPPFLAGS) APR_SAVE_THE_ENVIRONMENT(CFLAGS) APR_SAVE_THE_ENVIRONMENT(LDFLAGS) APR_SAVE_THE_ENVIRONMENT(LIBS) APR_SAVE_THE_ENVIRONMENT(INCLUDES) dnl Generate ./config.nice for reproducing runs of configure dnl APR_CONFIG_NICE(config.nice) AC_CANONICAL_SYSTEM echo "Configuring APR library" echo "Platform: $host" dnl # Some initial steps for configuration. We setup the default directory dnl # and which files are to be configured. dnl Do the various CC checks *before* preloading values. The preload code dnl may need to use compiler characteristics to make decisions. This macro dnl can only be used once within a configure script, so this prevents a dnl preload section from invoking the macro to get compiler info. AC_PROG_CC dnl Preload APR_PRELOAD dnl Absolute source/build directory abs_srcdir=`(cd $srcdir && pwd)` abs_builddir=`pwd` if test "$abs_builddir" != "$abs_srcdir"; then USE_VPATH=1 fi dnl Libtool might need this symbol -- it must point to the location of dnl the generated libtool script (not necessarily the "top" build dir). dnl top_builddir="$abs_builddir" AC_SUBST(top_builddir) AC_SUBST(abs_srcdir) dnl Directory containing apr build macros, helpers, and make rules dnl NOTE: make rules (rules.mk) will be in the builddir for vpath dnl apr_buildout=$abs_builddir/build apr_builders=$abs_srcdir/build AC_SUBST(apr_builders) MKDIR=$apr_builders/mkdir.sh dnl These added to allow default directories to be used... DEFAULT_OSDIR="unix" echo "(Default will be ${DEFAULT_OSDIR})" apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n user memory" dnl Checks for programs. AC_PROG_MAKE_SET AC_PROG_CPP AC_PROG_AWK AC_PROG_LN_S AC_PROG_RANLIB AC_PROG_INSTALL AC_CHECK_PROG(RM, rm, rm) AC_CHECK_TOOL(AR, ar, ar) dnl Various OS checks that apparently set required flags AC_AIX AC_ISC_POSIX AC_MINIX APR_EBCDIC dnl prep libtool dnl echo "performing libtool configuration..." case $host in *os2*) # Use a custom-made libtool replacement echo "using aplibtool" LIBTOOL="$srcdir/build/aplibtool" gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c ;; *) dnl libtoolize requires that the following not be indented AC_PROG_LIBTOOL if test "x$LTFLAGS" = "x"; then LTFLAGS='--silent' fi dnl get libtool's setting of shlibpath_var eval `grep "^shlibpath_var=[[A-Z_]]\+$" $abs_builddir/libtool` ;; esac AC_ARG_WITH(libtool, [ --without-libtool avoid using libtool to link the library], [ use_libtool=$withval ], [ use_libtool="yes" ] ) if test "x$use_libtool" = "xyes"; then lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@' link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@' so_ext='lo' lib_target='-rpath $(libdir) $$objects' export_lib_target='-rpath \$(libdir) \$\$objects' else lt_compile='$(COMPILE) -c $<' link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)' so_ext='o' lib_target='' export_lib_target='' fi dnl On AIX, libraries need to be specified on the link of lib_target lib_target_libs="" case $host in *aix*) lib_target_libs="\$(EXTRA_LIBS)"; ;; *-solaris2*) apr_platform_runtime_link_flag="-R" ;; *) ;; esac AC_SUBST(lt_compile) AC_SUBST(link) AC_SUBST(so_ext) AC_SUBST(lib_target) AC_SUBST(export_lib_target) AC_SUBST(shlibpath_var) AC_SUBST(LTFLAGS) AC_SUBST(LT_LDFLAGS) AC_SUBST(lib_target_libs) dnl #----------------------------- Checks for compiler flags nl=' ' echo $ac_n "${nl}Check for compiler flags...${nl}" AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,-Wall) elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath) fi ])dnl AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging and compile time warnings], [APR_ADDTO(CFLAGS,-g) if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations]) elif test "$AIX_XLC" = "yes"; then APR_ADDTO(CFLAGS,-qfullpath -qinitauto=FE) fi ])dnl AC_ARG_ENABLE(profile,[ --enable-profile Turn on profiling for the build (GCC)], if test "$GCC" = "yes"; then APR_ADDTO(CFLAGS, -pg) APR_REMOVEFROM(CFLAGS, -g) if test "$host" = "i586-pc-beos"; then APR_REMOVEFROM(CFLAGS, -O2) APR_ADDTO(CFLAGS, -O1) APR_ADDTO(LDFLAGS, -p) fi fi )dnl AC_ARG_ENABLE(pool-debug, [ --enable-pool-debug[[=yes|no|verbose|verbose-alloc|lifetime|owner|all]] Turn on pools debugging], [ if test -z "$enableval"; then APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=1) elif test ! "$enableval" = "no"; then apr_pool_debug=1 for i in $enableval do flag=0 case $i in yes) flag=1 ;; verbose) flag=2 ;; lifetime) flag=4 ;; owner) flag=8 ;; verbose-alloc) flag=16 ;; all) apr_pool_debug=31 ;; *) ;; esac if test $flag -gt 0; then apr_pool_debug=`expr '(' $apr_pool_debug - $apr_pool_debug % \ '(' $flag '*' 2 ')' ')' + $flag + $apr_pool_debug % $flag` fi done APR_ADDTO(CPPFLAGS, -DAPR_POOL_DEBUG=$apr_pool_debug) fi ]) dnl Electric Fence malloc checker. dnl --with-efence specifies the path to Electric Fence AC_ARG_WITH(efence, [ --with-efence[[=DIR]] path to Electric Fence installation], [ apr_efence_dir="$withval" if test "$apr_efence_dir" != "yes"; then APR_ADDTO(LDFLAGS,[-L$apr_efence_dir/lib]) if test "x$apr_platform_runtime_link_flag" != "x"; then APR_ADDTO(LDFLAGS, [$apr_platform_runtime_link_flag$apr_efence_dir/lib]) fi fi AC_CHECK_LIB(efence, malloc, [ APR_ADDTO(LIBS,-lefence) ], [ AC_MSG_ERROR(Electric Fence requested but not detected) ]) ]) if test "$host" = "i586-pc-beos"; then AC_ARG_ENABLE(malloc-debug,[ --enable-malloc-debug Switch on malloc_debug for BeOS], APR_REMOVEFROM(CFLAGS, -O2) APR_ADDTO(CPPFLAGS, -fcheck-memory-usage -D_KERNEL_MODE) ) dnl fi dnl # this is the place to put specific options for platform/compiler dnl # combinations case "$host:$CC" in *-hp-hpux*:cc ) APR_ADDTO(CFLAGS,[-Ae +DAportable +Z]) ;; powerpc-*-beos:mwcc* ) APR_SETVAR(CPP,[mwcc -E]) APR_SETVAR(CC,mwcc) APR_SETVAR(AR,ar) ;; esac config_subdirs="none" INSTALL_SUBDIRS="none" case $host in i386-ibm-aix* | *-ibm-aix[1-2].* | *-ibm-aix3.* | *-ibm-aix4.1 | *-ibm-aix4.1.* | *-ibm-aix4.2 | *-ibm-aix4.2.*) OSDIR="aix" APR_ADDTO(LDFLAGS,-lld) eolstr="\\n" ;; *-os2*) APR_ADDTO(CPPFLAGS,-DOS2) APR_ADDTO(CFLAGS,-Zmt) AC_CHECK_LIB(bsd, random) OSDIR="os2" enable_threads="system_threads" eolstr="\\r\\n" file_as_socket="0" ;; *beos*) OSDIR="beos" APR_ADDTO(CPPFLAGS,-DBEOS) enable_threads="system_threads" native_mmap_emul="1" APR_CHECK_DEFINE(BONE_VERSION, sys/socket.h) eolstr="\\n" osver=`uname -r` case $osver in 5.0.4) file_as_socket="1" ;; *) file_as_socket="0" ;; esac ;; *os390) OSDIR="os390" eolstr="\\n" ;; *os400) OSDIR="as400" eolstr="\\n" ;; *cygwin*) OSDIR="unix" APR_ADDTO(CPPFLAGS,-DCYGWIN) enable_threads="no" eolstr="\\n" ;; *) OSDIR="unix" eolstr="\\n" ;; esac AC_SUBST(eolstr) AC_SUBST(INSTALL_SUBDIRS) dnl For some platforms we need a version string which allows easy numeric dnl comparisons. case $host in *freebsd*) # 3.4-RELEASE: 340 4.1.1-RELEASE: 411 os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/' | sed -e 's/\(.\)\.\(.\)\-.*/\1\20/'` ;; *linux*) os_version=`uname -r | sed -e 's/\(.\)\.\(.\)\.\(.\).*/\1\2\3/'` ;; *) os_version=OS_VERSION_IS_NOT_SET ;; esac dnl #----------------------------- Checks for Any required Libraries dnl Note: Autoconf will always append LIBS with an extra " " in AC_CHECK_LIB. dnl It should check for LIBS being empty and set LIBS equal to the new value dnl without the extra " " in that case, but they didn't do that. So, we dnl end up LIBS="-lm -lcrypt -lnsl -ldl" which is an annoyance. AC_CHECK_LIB(nsl, gethostbyname) AC_SEARCH_LIBS(gethostname, nsl) AC_CHECK_LIB(socket, socket) AC_SEARCH_LIBS(crypt, crypt ufc) AC_CHECK_LIB(truerand, main) AC_CHECK_LIB(iconv, iconv) AC_CHECK_LIB(m, modf) dnl #----------------------------- Checking for Threads echo $ac_n "${nl}Checking for Threads...${nl}" if test -z "$enable_threads"; then AC_ARG_ENABLE(threads, [ --enable-threads Enable threading support in APR.], [ enable_threads=$enableval] , [ APR_CHECK_PTHREADS_H([ enable_threads="pthread" ] , [ enable_threads="no" ] ) ] ) fi if test "$enable_threads" = "no"; then threads="0" pthreadh="0" pthreadser="0" else if test "$enable_threads" = "pthread"; then # We have specified pthreads for our threading library, just make sure # that we have everything we need APR_PTHREADS_CHECK_SAVE APR_PTHREADS_CHECK APR_CHECK_PTHREADS_H([ threads="1" pthreadh="1" pthreadser="1" AC_DEFINE(USE_THREADS) ], [ threads="0" pthreadh="0" pthreadser="0" APR_PTHREADS_CHECK_RESTORE ] ) elif test "$enable_threads" = "system_threads"; then threads="1" pthreadh="0" pthreadser="0" else # We basically specified that we wanted threads, but not how to implement # them. In this case, just look for pthreads. In the future, we can check # for other threading libraries as well. APR_PTHREADS_CHECK_SAVE APR_PTHREADS_CHECK APR_CHECK_PTHREADS_H([ threads="1" pthreadh="1" pthreadser="1" AC_DEFINE(USE_THREADS) ], [ threads="0" pthreadser="0" pthreadh="0" APR_PTHREADS_CHECK_RESTORE ] ) fi if test "$pthreadh" = "1"; then APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS APR_CHECK_PTHREAD_ATTR_GETDETACHSTATE_ONE_ARG AC_CHECK_FUNCS(pthread_key_delete pthread_rwlock_init) if test "$ac_cv_func_pthread_rwlock_init" = "yes"; then dnl #----------------------------- Checking for pthread_rwlock_t dnl # Linux is silly as it has pthread_rwlock_init defined dnl # but keeps the pthread_rwlock_t structure hidden unless dnl # special things are defined. AC_TRY_COMPILE([#include #include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no) if test "$ac_cv_struct_pthread_rw" = "no"; then AC_TRY_COMPILE([#define _XOPEN_SOURCE 500 #define _BSD_SOURCE #define _SVID_SOURCE #include #include ], [pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER;], ac_cv_struct_pthread_rw=yes, ac_cv_struct_pthread_rw=no) if test "$ac_cv_struct_pthread_rw" = "yes"; then APR_ADDTO(CPPFLAGS, [-D_XOPEN_SOURCE=500 -D_BSD_SOURCE]) APR_ADDTO(CPPFLAGS, [-D_SVID_SOURCE]) fi fi fi fi fi ac_cv_define_READDIR_IS_THREAD_SAFE=no ac_cv_define_GETHOSTBYNAME_IS_THREAD_SAFE=no ac_cv_define_GETHOSTBYADDR_IS_THREAD_SAFE=no if test "$threads" = "1"; then echo "APR will use threads" AC_CHECK_LIB(c_r, readdir, AC_DEFINE(READDIR_IS_THREAD_SAFE)) if test "x$apr_gethostbyname_is_thread_safe" = "x"; then AC_CHECK_LIB(c_r, gethostbyname, apr_gethostbyname_is_thread_safe=yes) fi if test "$apr_gethostbyname_is_thread_safe" = "yes"; then AC_DEFINE(GETHOSTBYNAME_IS_THREAD_SAFE) fi if test "x$apr_gethostbyaddr_is_thread_safe" = "x"; then AC_CHECK_LIB(c_r, gethostbyaddr, apr_gethostbyaddr_is_thread_safe=yes) fi if test "$apr_gethostbyaddr_is_thread_safe" = "yes"; then AC_DEFINE(GETHOSTBYADDR_IS_THREAD_SAFE) fi AC_CHECK_FUNCS(gethostbyname_r gethostbyaddr_r) case "$host" in *-ibm-aix*) APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE]) ;; esac else echo "APR will be non-threaded" fi AC_CHECK_FUNCS(sigsuspend) AC_CHECK_FUNCS(sigwait, [ have_sigwait="1" ], [ have_sigwait="0" ]) dnl AC_CHECK_FUNCS doesn't work for this on Tru64 since the function dnl is renamed in signal.h. Todo: Autodetect case $host in *alpha*-dec-osf* ) have_sigwait="1" ;; esac AC_SUBST(threads) AC_SUBST(have_sigwait) AC_CHECK_FUNCS(poll) dnl #----------------------------- Checking for missing POSIX thread functions AC_CHECK_FUNCS(getpwnam_r) AC_CHECK_FUNCS(getpwuid_r) AC_CHECK_FUNCS(getgrnam_r) AC_CHECK_FUNCS(getgrgid_r) dnl #----------------------------- Checking for Shared Memory Support echo $ac_n "${nl}Checking for Shared Memory Support...${nl}" AC_CHECK_HEADERS(sys/mman.h) APR_CHECK_DEFINE(MAP_ANON, sys/mman.h) AC_CHECK_FUNCS(mmap munmap shm_open shm_unlink) APR_CHECK_FILE(/dev/zero) AC_CHECK_HEADERS(sys/ipc.h sys/shm.h sys/file.h) AC_CHECK_FUNCS(shmget shmat shmdt shmctl) AC_CHECK_HEADERS(kernel/OS.h) AC_CHECK_FUNCS(create_area) AC_CHECK_HEADERS(os2.h) dnl Now we determine which one is our anonymous shmem preference. haveshmgetanon="0" havemmapzero="0" havemmapanon="0" APR_BEGIN_DECISION([anonymous shared memory allocation method]) APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl func:shmget func:shmat func:shmdt func:shmctl, [haveshmgetanon="1" APR_DECIDE(USE_SHMEM_SHMGET_ANON, [SysV IPC shmget()])]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap file:/dev/zero, [havemmapzero="1" APR_DECIDE(USE_SHMEM_MMAP_ZERO, [SVR4-style mmap() on /dev/zero])]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap define:MAP_ANON, [havemmapanon="1" APR_DECIDE(USE_SHMEM_MMAP_ANON, [4.4BSD-style mmap() via MAP_ANON])]) APR_IFALLYES(header:os2.h, [haveos2shm="1" APR_DECIDE(USE_SHMEM_OS2_ANON, [OS/2 DosAllocSharedMem()])]) APR_IFALLYES(header:kernel/OS.h func:create_area, [havebeosshm="1" APR_DECIDE(USE_SHMEM_BEOS_ANON, [BeOS areas])]) case $host in *linux* ) dnl Linux has problems with MM_SHMT_MMANON even though it reports dnl that it has it. dnl FIXME - find exact 2.3 version that MMANON was fixed in. It is dnl confirmed fixed in 2.4 series. if test $os_version -le "240"; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_ZERO USE_SHMEM_SHMGET_ANON) fi ;; *hpux11* ) APR_DECISION_OVERRIDE(USE_SHMEM_SHMGET_ANON) ;; esac APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) useshmgetanon="0" usemmapzero="0" usemmapanon="0" case $ac_decision in USE_SHMEM_SHMGET_ANON ) useshmgetanon="1" ;; USE_SHMEM_MMAP_ZERO ) usemmapzero="1" ;; USE_SHMEM_MMAP_ANON ) usemmapanon="1" ;; esac AC_SUBST(useshmgetanon) AC_SUBST(usemmapzero) AC_SUBST(usemmapanon) AC_SUBST(haveshmgetanon) AC_SUBST(havemmapzero) AC_SUBST(havemmapanon) dnl Now we determine which one is our name-based shmem preference. havemmaptmp="0" havemmapshm="0" haveshmget="0" havebeosarea="0" haveos2shm="0" APR_BEGIN_DECISION([namebased memory allocation method]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap, [havemmaptmp="1" APR_DECIDE(USE_SHMEM_MMAP_TMP, [Classical mmap() on temporary file])]) APR_IFALLYES(header:sys/mman.h func:mmap func:munmap func:shm_open dnl func:shm_unlink, [havemmapshm="1" APR_DECIDE(USE_SHMEM_MMAP_SHM, [mmap() via POSIX.1 shm_open() on temporary file])]) APR_IFALLYES(header:sys/ipc.h header:sys/shm.h header:sys/file.h dnl func:shmget func:shmat func:shmdt func:shmctl, [haveshmget="1" APR_DECIDE(USE_SHMEM_SHMGET, [SysV IPC shmget()])]) APR_IFALLYES(header:kernel/OS.h func:create_area, [havebeosshm="1" APR_DECIDE(USE_SHMEM_BEOS, [BeOS areas])]) APR_IFALLYES(header:os2.h, [haveos2shm="1" APR_DECIDE(USE_SHMEM_OS2, [OS/2 DosAllocSharedMem()])]) case $host in *linux* ) dnl Linux has problems with MM_SHMT_MMANON even though it reports dnl that it has it. dnl FIXME - find exact 2.3 version that MMANON was fixed in. It is dnl confirmed fixed in 2.4 series. if test $os_version -le "240"; then APR_DECISION_OVERRIDE(USE_SHMEM_MMAP_TMP USE_SHMEM_MMAP_SHM dnl USE_SHMEM_SHMGET) fi ;; esac APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) usemmaptmp="0" usemmapshm="0" useshmget="0" usebeosarea="0" useos2shm="0" case $ac_decision in USE_SHMEM_MMAP_TMP ) usemmaptmp="1" ;; USE_SHMEM_MMAP_SHM ) usemmapshm="1" ;; USE_SHMEM_SHMGET ) useshmget="1" ;; USE_SHMEM_BEOS ) usebeosarea="1" ;; USE_SHMEM_OS2 ) useos2shm="1" ;; esac dnl Do we have any shared memory support? if test "$usemmaptmp$usemmapshm$usemmapzero$useshmget$usemmapanon$usebeosarea$useos2shm" = "0000000"; then sharedmem="0" else sharedmem="1" fi AC_SUBST(usemmaptmp) AC_SUBST(usemmapshm) AC_SUBST(useshmget) AC_SUBST(usebeosarea) AC_SUBST(useos2shm) AC_SUBST(havemmaptmp) AC_SUBST(havemmapshm) AC_SUBST(haveshmget) AC_SUBST(havebeosarea) AC_SUBST(haveos2shm) AC_SUBST(sharedmem) dnl #----------------------------- Checks for Any required Functions dnl Checks for library functions. (N.B. poll is further down) AC_CHECK_FUNCS(calloc strcasecmp stricmp setsid nl_langinfo isinf isnan) AC_CHECK_FUNCS(setrlimit, [ have_setrlimit="1" ], [ have_setrlimit="0" ]) AC_CHECK_FUNCS(getrlimit, [ have_getrlimit="1" ], [ have_getrlimit="0" ]) AC_CHECK_FUNCS(writev) sendfile="0" AC_CHECK_LIB(sendfile, sendfilev) AC_CHECK_FUNCS(sendfile send_file sendfilev, [ sendfile="1" ]) dnl THIS MUST COME AFTER THE THREAD TESTS - FreeBSD doesn't always have a dnl threaded poll() and we don't want to use sendfile on early FreeBSD dnl systems if we are also using threads. AC_ARG_WITH(sendfile, [ --with-sendfile Override decision to use sendfile], [ if test "$withval" = "yes"; then sendfile="1" else sendfile="0" fi ], [ orig_sendfile=$sendfile case $host in *freebsd*) if test $os_version -le "410"; then if test "$threads" = "1"; then sendfile="0" fi fi ;; *alpha*-dec-osf* ) sendfile="0" ;; s390-*-linux-gnu) sendfile="0" ;; esac if test "$orig_sendfile" != "$sendfile"; then echo "sendfile support disabled to avoid system problem" fi ] ) AC_SUBST(sendfile) AC_CHECK_FUNCS(sigaction, [ have_sigaction="1" ], [ have_sigaction="0" ]) AC_DECL_SYS_SIGLIST AC_CHECK_FUNCS(fork, [ fork="1" ], [ fork="0" ]) AC_CHECK_FUNCS(getpass) APR_CHECK_INET_ADDR APR_CHECK_INET_NETWORK AC_SUBST(apr_inaddr_none) AC_CHECK_FUNC(_getch) AC_CHECK_FUNCS(gmtime_r localtime_r) AC_CHECK_FUNCS(strerror_r, [ strerror_r="1" ], [ strerror_r="0" ]) if test "$strerror_r" = "1"; then APR_CHECK_STRERROR_R_RC fi AC_CHECK_FUNCS(iconv, [ iconv="1" ], [ iconv="0" ]) if test "$iconv" = "1"; then APR_CHECK_ICONV_INBUF fi AC_CHECK_FUNCS(mmap, [ mmap="1" ], [ mmap="0" ]) if test "$native_mmap_emul" = "1"; then mmap="1" fi AC_CHECK_FUNCS(hstrerror) AC_CHECK_FUNCS(memmove, [ have_memmove="1" ], [have_memmove="0" ]) AC_CHECK_FUNCS(mkstemp) AC_SUBST(fork) AC_SUBST(have_inet_addr) AC_SUBST(tcp_nodelay_inherited) AC_SUBST(have_inet_network) AC_SUBST(have_sigaction) AC_SUBST(have_setrlimit) AC_SUBST(have_getrlimit) AC_SUBST(iconv) AC_SUBST(mmap) AC_SUBST(have_memmove) APR_CHECK_SIGWAIT_ONE_ARG dnl #----------------------------- Checks for Any required Headers AC_HEADER_STDC APR_FLAG_HEADERS( ByteOrder.h \ conio.h \ crypt.h \ ctype.h \ dir.h \ dirent.h \ dl.h \ dlfcn.h \ errno.h \ fcntl.h \ grp.h \ iconv.h \ io.h \ langinfo.h \ limits.h \ mach-o/dyld.h \ malloc.h \ memory.h \ netdb.h \ osreldate.h \ poll.h \ process.h \ pwd.h \ signal.h \ stdarg.h \ stddef.h \ stdio.h \ stdlib.h \ string.h \ strings.h \ sysapi.h \ sysgtime.h \ termios.h \ time.h \ tpfeq.h \ tpfio.h \ unistd.h \ unix.h \ arpa/inet.h \ kernel/OS.h \ net/errno.h \ netinet/in.h \ sys/file.h \ sys/mman.h \ sys/poll.h \ sys/resource.h \ sys/select.h \ sys/sem.h \ sys/sendfile.h \ sys/signal.h \ sys/socket.h \ sys/stat.h \ sys/syslimits.h \ sys/time.h \ sys/types.h \ sys/uio.h \ sys/un.h \ sys/wait.h) dnl IRIX 6.5 has a problem in which prevents it from dnl being included by itself. Check for manually, dnl including another header file first. AC_MSG_CHECKING(for netinet/tcp.h) AC_TRY_CPP([ #ifdef HAVE_NETINET_IN_H #include #endif #include ], netinet_tcph="1", netinet_tcph="0") if test $netinet_tcph = 1; then AC_MSG_RESULT(yes) echo "#define HAVE_NETINET_TCP_H 1" >> confdefs.h else AC_MSG_RESULT(no) fi AC_SUBST(arpa_ineth) AC_SUBST(conioh) AC_SUBST(ctypeh) AC_SUBST(crypth) AC_SUBST(errnoh) AC_SUBST(direnth) AC_SUBST(fcntlh) AC_SUBST(ioh) AC_SUBST(limitsh) AC_SUBST(netdbh) AC_SUBST(sys_syslimitsh) AC_SUBST(netinet_inh) AC_SUBST(netinet_tcph) AC_SUBST(stdargh) AC_SUBST(stdioh) AC_SUBST(stdlibh) AC_SUBST(stringh) AC_SUBST(stringsh) AC_SUBST(sys_sendfileh) AC_SUBST(sys_signalh) AC_SUBST(sys_socketh) AC_SUBST(sys_typesh) AC_SUBST(sys_timeh) AC_SUBST(sys_uioh) AC_SUBST(sys_unh) AC_SUBST(timeh) AC_SUBST(unistdh) AC_SUBST(signalh) AC_SUBST(sys_waith) AC_SUBST(pthreadh) dnl #----------------------------- Checking for h_errno in if test "$netdbh" = "1"; then APR_CHECK_H_ERRNO_FLAG if test "$ac_cv_h_errno_cflags" = "no"; then AC_MSG_ERROR([can not find h_errno in netdb.h]) fi fi dnl #----------------------------- Checks for standard typedefs AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_UID_T AC_CHECK_TYPE(ssize_t, int) AC_C_INLINE AC_C_CONST AC_TYPE_SIZE_T AC_FUNC_SETPGRP APR_CHECK_SOCKLEN_T APR_INADDR_NONE dnl # Checks for integer size AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(long double, 12) AC_CHECK_SIZEOF(long long, 8) if test "$ac_cv_sizeof_short" = "2"; then short_value=short fi if test "$ac_cv_sizeof_int" = "4"; then int_value=int fi dnl # Now we need to find what apr_int64_t (sizeof == 8) will be. dnl # The first match is our preference. if test "$ac_cv_sizeof_int" = "8"; then int64_literal='#define APR_INT64_C(val) (val)' int64_t_fmt='#define APR_INT64_T_FMT "d"' int64_value="int" long_value=int elif test "$ac_cv_sizeof_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##L)' int64_t_fmt='#define APR_INT64_T_FMT "ld"' int64_value="long" long_value=long elif test "$ac_cv_sizeof_long_long" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' dnl Linux, Solaris, FreeBSD all support ll with printf. dnl BSD 4.4 originated 'q'. Solaris is more popular and dnl doesn't support 'q'. Solaris wins. Exceptions can dnl go to the OS-dependent section. int64_t_fmt='#define APR_INT64_T_FMT "lld"' int64_value="long long" long_value="long long" elif test "$ac_cv_sizeof_long_double" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LD)' int64_t_fmt='#define APR_INT64_T_FMT "Ld"' int64_value="long double" long_value="long double" elif test "$ac_cv_sizeof_longlong" = "8"; then int64_literal='#define APR_INT64_C(val) (val##LL)' int64_t_fmt='#define APR_INT64_T_FMT "qd"' int64_value="__int64" long_value="__int64" else dnl # int64_literal may be overriden if your compiler thinks you have dnl # a 64-bit value but APR does not agree. int64_literal='#error Can not determine the proper size for apr_int64_t' int64_t_fmt='#error Can not determine the proper size for apr_int64_t' fi dnl # If present, allow the C99 macro INT64_C to override our conversion. APR_CHECK_DEFINE(INT64_C, stdint.h) if test "$ac_cv_define_INT64_C" = "yes"; then int64_literal='#define APR_INT64_C(val) INT64_C(val)' stdint=1 else stdint=0 fi if test "$ac_cv_type_off_t" = "yes"; then off_t_value="off_t" else off_t_value="apr_int32_t" fi if test "$ac_cv_type_size_t" = "yes"; then size_t_value="size_t" else size_t_value="apr_int32_t" fi if test "$ac_cv_type_ssize_t" = "yes"; then ssize_t_value="ssize_t" else ssize_t_value="apr_int32_t" fi if test "$ac_cv_socklen_t" = "yes"; then socklen_t_value="socklen_t" else socklen_t_value="int" fi APR_CHECK_SIZEOF_EXTENDED([#include ], ssize_t, 8) if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' else ssize_t_fmt='#error Can not determine the proper size for ssize_t' fi APR_CHECK_SIZEOF_EXTENDED([#include ], size_t, 8) if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then size_t_fmt='#define APR_SIZE_T_FMT "d"' elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then size_t_fmt='#define APR_SIZE_T_FMT "ld"' else size_t_fmt='#error Can not determine the proper size for size_t' fi APR_CHECK_SIZEOF_EXTENDED([#include ], off_t, 8) if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then off_t_fmt='#define APR_OFF_T_FMT "d"' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then off_t_fmt='#define APR_OFF_T_FMT "qd"' else off_t_fmt='#error Can not determine the proper size for off_t' fi APR_CHECK_SIZEOF_EXTENDED([#include ], pid_t, 8) if test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then os_proc_t_fmt='#define APR_OS_PROC_T_FMT "d"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then os_proc_t_fmt='#define APR_OS_PROC_T_FMT "qd"' else os_proc_t_fmt='#error Can not determine the proper size for pid_t' fi # Basically, we have tried to figure out the correct format strings # for APR types which vary between platforms, but we don't always get # it right. If you find that we don't get it right for your platform, # you can override our decision below. case $host in *linux*) off_t_fmt='#define APR_OFF_T_FMT "ld"' ;; *os2_emx) off_t_fmt='#define APR_OFF_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; *-solaris*) off_t_fmt='#define APR_OFF_T_FMT "ld"' os_proc_t_fmt='#define APR_OS_PROC_T_FMT "ld"' ;; *aix4*|*aix5*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "ld"' off_t_fmt='#define APR_OFF_T_FMT "ld"' ;; *beos*) ssize_t_fmt='#define APR_SSIZE_T_FMT "ld"' size_t_fmt='#define APR_SIZE_T_FMT "ld"' ;; *apple-darwin*) ssize_t_fmt='#define APR_SSIZE_T_FMT "d"' size_t_fmt='#define APR_SIZE_T_FMT "lu"' ;; esac AC_SUBST(short_value) AC_SUBST(int_value) AC_SUBST(long_value) AC_SUBST(int64_value) AC_SUBST(off_t_value) AC_SUBST(size_t_value) AC_SUBST(ssize_t_value) AC_SUBST(socklen_t_value) AC_SUBST(int64_t_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt) AC_SUBST(off_t_fmt) AC_SUBST(os_proc_t_fmt) AC_SUBST(int64_literal) AC_SUBST(stdint) dnl #----------------------------- Checking for string functions AC_CHECK_FUNCS(strnicmp, have_strnicmp="1", have_strnicmp="0") AC_CHECK_FUNCS(strncasecmp, have_strncasecmp="1", have_strncasecmp="0") AC_CHECK_FUNCS(stricmp, have_stricmp="1", have_stricmp="0") AC_CHECK_FUNCS(strcasecmp, have_strcasecmp="1", have_strcasecmp="0") AC_CHECK_FUNCS(strdup, have_strdup="1", have_strdup="0") AC_CHECK_FUNCS(strstr, have_strstr="1", have_strstr="0") AC_CHECK_FUNCS(memchr, have_memchr="1", have_memchr="0") AC_SUBST(have_strnicmp) AC_SUBST(have_strncasecmp) AC_SUBST(have_stricmp) AC_SUBST(have_strcasecmp) AC_SUBST(have_strdup) AC_SUBST(have_strstr) AC_SUBST(have_memchr) dnl #----------------------------- Checking for DSO support echo $ac_n "${nl}Checking for DSO...${nl}" AC_ARG_ENABLE(dso, [ --enable-dso Enable dso support ], [ tempdso=$enableval], [ AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ]) if test "$tempdso" = "no"; then AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ], tempdso="no") fi if test "$tempdso" = "no"; then AC_CHECK_FUNCS(dlopen, [ tempdso="dlfcn" ], [ tempdso="no" ]) fi if test "$tempdso" = "no"; then AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no") fi if test "$tempdso" = "no"; then AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" APR_ADDTO(LIBS,-ldld) ], tempdso="no") fi if test "$tempdso" = "no"; then case $host in *os390|*-os2*|*os400) tempdso="yes" ;; esac fi ] ) if test "$tempdso" = "no"; then aprdso="0" else case "$tempdso" in dlfcn) AC_DEFINE(DSO_USE_DLFCN);; shl) AC_DEFINE(DSO_USE_SHL);; dyld) AC_DEFINE(DSO_USE_DYLD);; esac aprdso="1" apr_modules="$apr_modules dso" fi AC_SUBST(aprdso) dnl #----------------------------- Checking for Processes echo $ac_n "${nl}Checking for Processes...${nl}" AC_CHECK_FUNCS(waitpid) AC_ARG_ENABLE(other-child, [ --enable-other-child Enable reliable child processes ], [ if test "$enableval" = "yes"; then oc="1" else oc="0" fi ], [ oc=1 ] ) AC_SUBST(oc) AC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[ AC_TRY_RUN([ #include #include #include main() { struct rlimit limit; limit.rlim_cur = 0; limit.rlim_max = 0; exit(0); }], [ ac_cv_struct_rlimit=yes ], [ ac_cv_struct_rlimit=no ], [ ac_cv_struct_rlimit=no ] ) ] ) struct_rlimit=0 test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1 AC_SUBST(struct_rlimit) dnl #----------------------------- Checking for Locking Characteristics echo $ac_n "${nl}Checking for Locking...${nl}" AC_CHECK_FUNCS(semget semctl flock) APR_CHECK_FILE(/dev/zero) # It's stupid, but not all platforms have union semun, even those that need it. AC_MSG_CHECKING(for union semun in sys/sem.h) AC_TRY_COMPILE([ #include #include #include ],[ union semun arg; semctl(0, 0, 0, arg); ], [have_union_semun="1" union_semun=yes ] msg=yes, [ have_union_semun="0" msg=no ] ) AC_MSG_RESULT([$msg]) AC_SUBST(have_union_semun) dnl Checks for libraries. APR_CHECK_DEFINE(LOCK_EX, sys/file.h) APR_CHECK_DEFINE(F_SETLK, fcntl.h) APR_CHECK_DEFINE(SEM_UNDO, sys/sem.h) APR_CHECK_DEFINE(CODESET, langinfo.h) # We are assuming that if the platform doesn't have POLLIN, it doesn't have # any POLL definitions. APR_CHECK_DEFINE_FILES(POLLIN, poll.h sys/poll.h) if test "$threads" = "1"; then APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h) AC_CHECK_FUNCS(pthread_mutexattr_setpshared) dnl Some systems have setpshared and define PROCESS_SHARED, but don't dnl really support PROCESS_SHARED locks. So, we must validate that we dnl can go through the steps without receiving some sort of system error. dnl Linux and older versions of AIX have this problem. APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, AC_TRY_RUN([ #include #include int main() { pthread_mutex_t mutex; pthread_mutexattr_t attr; if (pthread_mutexattr_init(&attr)) exit(1); if (pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)) exit(2); if (pthread_mutex_init(&mutex, &attr)) exit(3); if (pthread_mutexattr_destroy(&attr)) exit(4); if (pthread_mutex_destroy(&mutex)) exit(5); exit(0); }], [], [ac_cv_func_pthread_mutexattr_setpshared=no], [ac_cv_func_pthread_mutexattr_setpshared=no])) if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then AC_CHECK_FUNCS(pthread_mutexattr_setrobust_np) if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "no"; then AC_TRY_COMPILE([#define _POSIX_THREAD_PRIO_INHERIT #include #include ],[ int main() { pthread_mutex_t mutex; pthread_mutexattr_t attr; if (pthread_mutexattr_init(&attr)) exit(1); if (pthread_mutexattr_setrobust_np(&attr, PTHREAD_MUTEX_ROBUST_NP)) exit(2); if (pthread_mutex_init(&mutex, &attr)) exit(3); if (pthread_mutexattr_destroy(&attr)) exit(4); if (pthread_mutex_destroy(&mutex)) exit(5); exit(0); }], [ac_cv_func_pthread_mutexattr_setrobust_np=yes], []) if test "$ac_cv_func_pthread_mutexattr_setrobust_np" = "yes"; then APR_ADDTO(CPPFLAGS, -D_POSIX_THREAD_PRIO_INHERIT) fi fi fi fi # See which lock mechanisms we can support on this system. APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, hassysvser="1", hassysvser="0") APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1", hasflockser="0") APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1", hasfcntlser="0") # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, hasprocpthreadser="1", hasprocpthreadser="0") APR_IFALLYES(struct:pthread_rw, hasrwlockser="1", hasrwlockser="0") # See which lock mechanism we'll select by default on this system. # The last APR_DECIDE to execute sets the default APR_BEGIN_DECISION([apr_lock implementation method]) APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()])) APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()])) # note: the current APR use of shared mutex requires /dev/zero APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, APR_DECIDE(USE_PROC_PTHREAD_SERIALIZE, [pthread mutex])) APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method) fi APR_END_DECISION AC_DEFINE_UNQUOTED($ac_decision) flockser="0" sysvser="0" procpthreadser="0" fcntlser="0" case $ac_decision in USE_FLOCK_SERIALIZE ) flockser="1" ;; USE_SYSVSEM_SERIALIZE ) sysvser="1" ;; USE_FCNTL_SERIALIZE ) fcntlser="1" ;; USE_PROC_PTHREAD_SERIALIZE ) procpthreadser="1" ;; esac AC_SUBST(hasflockser) AC_SUBST(hassysvser) AC_SUBST(hasfcntlser) AC_SUBST(hasprocpthreadser) AC_SUBST(hasrwlockser) AC_SUBST(flockser) AC_SUBST(sysvser) AC_SUBST(fcntlser) AC_SUBST(procpthreadser) AC_SUBST(pthreadser) AC_MSG_CHECKING(if interprocess lock affects threads) if test "x$apr_process_lock_is_global" = "xyes"; then proclockglobal="1" AC_MSG_RESULT(yes) else proclockglobal="0" AC_MSG_RESULT(no) fi AC_SUBST(proclockglobal) dnl #----------------------------- Checking for /dev/random AC_MSG_CHECKING(for /dev/random) if test -r "/dev/random"; then AC_DEFINE(DEV_RANDOM, [/dev/random]) AC_MSG_RESULT(/dev/random) rand="1" elif test -r "/dev/urandom"; then AC_DEFINE(DEV_RANDOM, [/dev/urandom]) AC_MSG_RESULT(/dev/urandom) rand="1" else case $host in # we have built in support for OS/2 *-os2*) AC_MSG_RESULT([Using OS/2 builtin random]) rand="1" ;; *) AC_ARG_WITH(egd, [ --with-egd= use egd-compatible socket], [ if test "$withval" = "yes"; then AC_ERROR([You must specify a default EGD socket path.]) fi AC_DEFINE(HAVE_EGD) AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, [$withval]) AC_MSG_RESULT(EGD-compatible daemon) rand="1" ]) if test "$rand" != "1"; then if test "$ac_cv_lib_truerand_main" = "yes"; then AC_DEFINE(HAVE_TRUERAND) AC_MSG_RESULT(truerand) rand="1" else AC_MSG_RESULT(not found) rand="0" fi fi ;; esac fi AC_SUBST(rand) dnl #----------------------------- Checking for Time Support echo $ac_n "${nl}Checking for Time Support...${nl}" AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff, [AC_TRY_COMPILE([#include #include ], [struct tm tm; tm.tm_gmtoff;], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)]) if test "$ac_cv_struct_tm_gmtoff" = "yes"; then AC_DEFINE(HAVE_GMTOFF) fi dnl #----------------------------- Checking for Networking Support echo $ac_n "${nl}Checking for Networking support...${nl}" AC_MSG_CHECKING(for in_addr in netinet/in.h) AC_TRY_COMPILE([ #include #include ],[ struct in_addr arg; arg.s_addr = htonl(INADDR_ANY); ], [ have_in_addr="1" msg=yes ] , [ have_in_addr="0" msg=no ]) AC_MSG_RESULT([$msg]) AC_MSG_CHECKING([if fd == socket on this platform]) if test "x$file_as_socket" != "x0" ; then file_as_socket="1"; echo "yes" else echo "no" fi AC_SUBST(have_in_addr) AC_SUBST(file_as_socket) APR_CHECK_SOCKADDR_SA_LEN APR_CHECK_GETHOSTBYNAME_NAS dnl Check the types only if we have gethostbyname_r if test "$ac_cv_func_gethostbyname_r" = "yes"; then APR_CHECK_GETHOSTBYNAME_R_STYLE fi APR_CHECK_TCP_NODELAY_INHERITED dnl # Look for a way of corking TCP... APR_CHECK_DEFINE(TCP_CORK, netinet/tcp.h) APR_CHECK_DEFINE(TCP_NOPUSH, netinet/tcp.h) apr_tcp_nopush_flag="0" have_corkable_tcp="0" if test "x$ac_cv_define_TCP_CORK" = "xyes"; then apr_tcp_nopush_flag="TCP_CORK" have_corkable_tcp="1" else case $host in *linux*) AC_EGREP_CPP(yes,[ #include #ifdef TCP_CORK yes #endif ],[ apr_tcp_nopush_flag="3" have_corkable_tcp="1" ]) ;; *) ;; esac fi if test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then apr_tcp_nopush_flag="TCP_NOPUSH" have_corkable_tcp="1" fi APR_CHECK_DEFINE(SO_ACCEPTFILTER, sys/socket.h) if test "x$ac_cv_define_SO_ACCEPTFILTER" = "xyes"; then acceptfilter="1" else acceptfilter="0" fi AC_SUBST(apr_tcp_nopush_flag) AC_SUBST(have_corkable_tcp) AC_SUBST(acceptfilter) AC_CHECK_FUNCS(set_h_errno) echo $ac_n "${nl}Checking for IPv6 Networking support...${nl}" dnl # Start of checking for IPv6 support... AC_ARG_ENABLE(ipv6, [ --disable-ipv6 Disable IPv6 support in APR.], [ if test "$enableval" = "no"; then user_disabled_ipv6=1 fi ], [ user_disabled_ipv6=0 ] ) AC_SEARCH_LIBS(getaddrinfo, inet6) AC_SEARCH_LIBS(gai_strerror, inet6) AC_SEARCH_LIBS(getnameinfo, inet6) AC_CHECK_FUNCS(gai_strerror) APR_CHECK_WORKING_GETADDRINFO APR_CHECK_NEGATIVE_EAI APR_CHECK_WORKING_GETNAMEINFO APR_CHECK_SOCKADDR_IN6 AC_MSG_CHECKING(if APR supports IPv6) have_ipv6="0" if test "$user_disabled_ipv6" = 1; then AC_MSG_RESULT("no -- disabled by user") else if test "x$have_sockaddr_in6" = "x1"; then if test "x$ac_cv_working_getaddrinfo" = "xyes"; then if test "x$ac_cv_working_getnameinfo" = "xyes"; then have_ipv6="1" AC_MSG_RESULT("yes") else AC_MSG_RESULT("no -- no getnameinfo") fi else AC_MSG_RESULT("no -- no working getaddrinfo") fi else AC_MSG_RESULT("no -- no sockaddr_in6"); fi fi AC_SUBST(have_ipv6) dnl #----------------------------- Finalize the variables echo $ac_n "${nl}Restore user-defined environment settings...${nl}" APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, EXTRA_) APR_RESTORE_THE_ENVIRONMENT(CFLAGS, EXTRA_) APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, EXTRA_) APR_RESTORE_THE_ENVIRONMENT(LIBS, EXTRA_) APR_RESTORE_THE_ENVIRONMENT(INCLUDES, EXTRA_) AC_SUBST(NOTEST_CPPFLAGS) AC_SUBST(NOTEST_CFLAGS) AC_SUBST(NOTEST_LDFLAGS) AC_SUBST(NOTEST_LIBS) AC_SUBST(NOTEST_INCLUDES) dnl #----------------------------- Construct the files AC_SUBST(LDLIBS) AC_SUBST(AR) AC_SUBST(RM) AC_SUBST(OSDIR) AC_SUBST(DEFAULT_OSDIR) AC_SUBST(EXEEXT) AC_SUBST(LIBTOOL_LIBS) echo "${nl}Construct Makefiles and header files." MAKEFILE1="Makefile strings/Makefile passwd/Makefile tables/Makefile build/Makefile" SUBDIRS="strings passwd tables " for dir in $apr_modules do test -d $dir || $MKDIR $dir if test -f $srcdir/$dir/$OSDIR/Makefile.in; then MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile " SUBDIRS="$SUBDIRS $dir/$OSDIR " else MAKEFILE2="$MAKEFILE2 $dir/$DEFAULT_OSDIR/Makefile " SUBDIRS="$SUBDIRS $dir/$DEFAULT_OSDIR " fi done if test -d ./test; then MAKEFILE3="test/Makefile" fi AC_SUBST(SUBDIRS) dnl dnl BSD/OS (BSDi) needs to use a different include syntax in the Makefiles dnl case $host in *bsdi*) # Check whether they've installed GNU make if make --version > /dev/null 2>&1; then INCLUDE_RULES="include $apr_buildout/rules.mk" else # BSDi make INCLUDE_RULES=".include \"$apr_buildout/rules.mk\"" fi ;; *) INCLUDE_RULES="include $apr_buildout/rules.mk" ;; esac AC_SUBST(INCLUDE_RULES) SAVE_FILES="include/apr.h include/arch/unix/apr_private.h" for i in $SAVE_FILES; do test -r $i && mv $i $i.save done dir=include/arch/unix test -d $dir || $MKDIR $dir AC_OUTPUT([ $MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS build/rules.mk apr-config ],[ for i in $SAVE_FILES; do if cmp -s $i $i.save 2>/dev/null; then mv $i.save $i echo "$i is unchanged" fi rm -f $i.save done chmod +x apr-config ]) dnl #----------------------------- Fixup Makefiles for VPATH support changequote({,}) if test -n "$USE_VPATH"; then for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do dir=`echo $makefile|sed 's%[^/][^/]*$%%'` (cat < tmp cp tmp $makefile done rm -f tmp fi changequote([,])