configure.in
来自「linux网络服务器工具」· IN 代码 · 共 2,247 行 · 第 1/5 页
IN
2,247 行
exit(0); }], [apr_cv_process_shared_works=yes], [apr_cv_process_shared_works=no])]) # Override detection of pthread_mutexattr_setpshared ac_cv_func_pthread_mutexattr_setpshared=$apr_cv_process_shared_works]) if test "$ac_cv_func_pthread_mutexattr_setpshared" = "yes"; then APR_CHECK_PTHREAD_ROBUST_SHARED_MUTEX fifi# See which lock mechanisms we can support on this system.APR_IFALLYES(header:semaphore.h func:sem_open func:sem_close dnl func:sem_unlink func:sem_post func:sem_wait, hasposixser="1", hasposixser="0")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/zeroAPR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED dnl func:pthread_mutexattr_setpshared dnl file:/dev/zero, hasprocpthreadser="1", hasprocpthreadser="0")APR_IFALLYES(header:OS.h func:create_sem, hasbeossem="1", hasbeossem="0")# See which lock mechanism we'll select by default on this system.# The last APR_DECIDE to execute sets the default.# At this stage, we match the ordering in Apache 1.3# which is (highest to lowest): sysvsem -> fcntl -> flock.# POSIX semaphores and cross-process pthread mutexes are not# used by default since they have less desirable behaviour when# e.g. a process holding the mutex segfaults.# The BEOSSEM decision doesn't require any substitutions but is# included here to prevent the fcntl() branch being selected# from the decision making.APR_BEGIN_DECISION([apr_lock implementation method])APR_IFALLYES(func:flock define:LOCK_EX, APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()]))APR_IFALLYES(header:fcntl.h define:F_SETLK, APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))APR_IFALLYES(func:semget func:semctl define:SEM_UNDO, APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))APR_IFALLYES(header:OS.h func:create_sem, APR_DECIDE(USE_BEOSSEM, [BeOS Semaphores])) if test "x$apr_lock_method" != "x"; then APR_DECISION_FORCE($apr_lock_method)fiAPR_END_DECISIONAC_DEFINE_UNQUOTED($ac_decision)flockser="0"sysvser="0"posixser="0"procpthreadser="0"fcntlser="0"case $ac_decision in USE_FLOCK_SERIALIZE ) flockser="1" ;; USE_FCNTL_SERIALIZE ) fcntlser="1" ;; USE_SYSVSEM_SERIALIZE ) sysvser="1" ;; USE_POSIXSEM_SERIALIZE ) posixser="1" ;; USE_PROC_PTHREAD_SERIALIZE ) procpthreadser="1" ;; USE_BEOSSEM ) beossem="1" ;;esacAC_SUBST(hasflockser)AC_SUBST(hassysvser)AC_SUBST(hasposixser)AC_SUBST(hasfcntlser)AC_SUBST(hasprocpthreadser)AC_SUBST(flockser)AC_SUBST(sysvser)AC_SUBST(posixser)AC_SUBST(fcntlser)AC_SUBST(procpthreadser)AC_SUBST(pthreadser)AC_MSG_CHECKING(if all interprocess locks affect threads)if test "x$apr_process_lock_is_global" = "xyes"; then proclockglobal="1" AC_MSG_RESULT(yes)else proclockglobal="0" AC_MSG_RESULT(no)fiAC_SUBST(proclockglobal)AC_MSG_CHECKING(if POSIX sems affect threads in the same process)if test "x$apr_posixsem_is_global" = "xyes"; then AC_DEFINE(POSIXSEM_IS_GLOBAL, 1, [Define if POSIX semaphores affect threads within the process]) AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fiAC_MSG_CHECKING(if SysV sems affect threads in the same process)if test "x$apr_sysvsem_is_global" = "xyes"; then AC_DEFINE(SYSVSEM_IS_GLOBAL, 1, [Define if SysV semaphores affect threads within the process]) AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fiAC_MSG_CHECKING(if fcntl locks affect threads in the same process)if test "x$apr_fcntl_is_global" = "xyes"; then AC_DEFINE(FCNTL_IS_GLOBAL, 1, [Define if fcntl locks affect threads within the process]) AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fiAC_MSG_CHECKING(if flock locks affect threads in the same process)if test "x$apr_flock_is_global" = "xyes"; then AC_DEFINE(FLOCK_IS_GLOBAL, 1, [Define if flock locks affect threads within the process]) AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fidnl ----------------------------- Checking for /dev/random AC_MSG_CHECKING(for entropy source)why_no_rand=""AC_ARG_WITH(egd, [ --with-egd[[=DIR]] use EGD-compatible socket], [ AC_DEFINE(HAVE_EGD, 1, [Define if EGD is supported]) if test "$withval" = "yes"; then AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"], [Define to list of paths to EGD sockets]) else AC_DEFINE_UNQUOTED(EGD_DEFAULT_SOCKET, ["$withval"]) fi AC_MSG_RESULT(EGD-compatible daemon) rand="1" ])if test "$rand" != "1"; then AC_ARG_WITH(devrandom, [ --with-devrandom[[=DEV]] use /dev/random or compatible [[searches by default]]], [ apr_devrandom="$withval" ], [ apr_devrandom="yes" ]) if test "$apr_devrandom" = "yes"; then # /dev/random on OpenBSD doesn't provide random data, so # prefer /dev/arandom, which does; see random(4). for f in /dev/arandom /dev/urandom /dev/random; do if test -r $f; then apr_devrandom=$f rand=1 break fi done elif test "$apr_devrandom" != "no"; then if test -r "$apr_devrandom"; then rand="1" else AC_ERROR([$apr_devrandom not found or unreadable.]) fi fi if test "$rand" = "1"; then case $host in *os390) if test $os_version -lt 1700; then rand="0" why_no_rand=" ($apr_devrandom unusable on z/OS before V1R7)" fi ;; esac fi if test "$rand" = "1"; then AC_DEFINE_UNQUOTED(DEV_RANDOM, ["$apr_devrandom"], [Define to path of random device]) AC_MSG_RESULT([$apr_devrandom]) fifiif test "$rand" != "1"; then case $host in # we have built in support for OS/2 *-os2*) AC_MSG_RESULT([Using OS/2 builtin random]) rand="1" ;; *) if test "$rand" != "1"; then if test "$ac_cv_lib_truerand_main" = "yes"; then AC_DEFINE(HAVE_TRUERAND, 1, [Define if truerand is supported]) AC_MSG_RESULT(truerand) rand="1" else AC_MSG_RESULT(not found$why_no_rand) rand="0" fi fi ;; esacfiAC_SUBST(rand)dnl ----------------------------- Checking for File Info Support echo "${nl}Checking for File Info Support..."AC_CHECK_MEMBERS([struct stat.st_blocks, struct stat.st_atimensec,struct stat.st_ctimensec, struct stat.st_mtimensec, struct stat.st_atim.tv_nsec,struct stat.st_ctim.tv_nsec, struct stat.st_mtim.tv_nsec,struct stat.st_atime_n, struct stat.st_ctime_n, struct stat.st_mtime_n],,,[#ifdef HAVE_SYS_TYPES_H#include <sys/types.h>#endif#ifdef HAVE_SYS_STAT_H#include <sys/stat.h>#endif#ifdef HAVE_UNISTD_H#include <unistd.h>#endif])APR_CHECK_DIRENT_INODEAPR_CHECK_DIRENT_TYPEdnl ----------------------------- Checking for UUID Support echo "${nl}Checking for OS UUID Support..."AC_CHECK_HEADERS(uuid.h uuid/uuid.h sys/uuid.h, break)apr_revert_save_LIBS=$LIBS# Prefer the flavor(s) that live in libc;AC_SEARCH_LIBS(uuid_create, uuid)AC_SEARCH_LIBS(uuid_generate, uuid)if test "$ac_cv_search_uuid_create" = "none required" -o \ "$ac_cv_search_uuid_generate" = "none required"; then LIBS=$apr_revert_save_LIBSfiAC_CHECK_FUNCS(uuid_create uuid_generate)AC_CACHE_CHECK([for os uuid usability], [apr_cv_osuuid], [# Ensure this test closely mirrors misc/unix/rand.c!uuid_includes="#if defined(HAVE_SYS_TYPES_H)#include <sys/types.h>#endif#if defined(HAVE_UNISTD_H)#include <unistd.h>#endif#if defined(HAVE_UUID_H)#include <uuid.h>#elif defined(HAVE_UUID_UUID_H)#include <uuid/uuid.h>#elif defined(HAVE_SYS_UUID_H)#include <sys/uuid.h>#endif" apr_cv_osuuid=no if test $ac_cv_func_uuid_create = yes; then AC_TRY_LINK([$uuid_includes], [ uuid_t g; uint32_t s; uuid_create(&g, &s); if (s == uuid_s_ok) s = 0; ], [apr_cv_osuuid=yes], [apr_cv_func_uuid_create=no]) fi if test $ac_cv_func_uuid_generate = yes; then AC_TRY_LINK([$uuid_includes], [ uuid_t g; uuid_generate(g); ], [apr_cv_osuuid=yes], [apr_cv_func_uuid_generate=no]) fi ])if test $apr_cv_osuuid = yes; then osuuid="1"else osuuid="0" LIBS=$apr_revert_save_LIBSfiAC_SUBST(osuuid)dnl ----------------------------- Checking for Time Support echo "${nl}Checking for Time Support..."AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,[#include <sys/types.h>#include <time.h>])dnl ----------------------------- Checking for Networking Support echo "${nl}Checking for Networking support..."APR_TYPE_IN_ADDRif test "$ac_cv_type_in_addr" = "yes"; then have_in_addr="1"else have_in_addr="0"fiAC_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"fiAC_SUBST(have_in_addr)AC_SUBST(file_as_socket)if test "$ac_cv_func_poll $file_as_socket" = "yes 1"; then AC_DEFINE(WAITIO_USES_POLL, 1, [Define if apr_wait_for_io_or_timeout() uses poll(2)])fi# Check the types only if we have gethostbyname_rif test "$ac_cv_func_gethostbyname_r" = "yes"; then APR_CHECK_GETHOSTBYNAME_R_STYLEfiAPR_CHECK_TCP_NODELAY_INHERITEDAPR_CHECK_O_NONBLOCK_INHERITEDAPR_CHECK_TCP_NODELAY_WITH_CORK# 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 <linux/socket.h>#ifdef TCP_CORKyes#endif ],[ apr_tcp_nopush_flag="3" have_corkable_tcp="1" ]) ;; *) ;; esacfiif test "x$ac_cv_define_TCP_NOPUSH" = "xyes"; then apr_tcp_nopush_flag="TCP_NOPUSH" have_corkable_tcp="1"fiAPR_CHECK_DEFINE(SO_ACCEPTFILTER, sys/socket.h)if test "x$ac_cv_define_SO_ACCEPTFILTER" = "xyes"; then acceptfilter="1"else acceptfilter="0"fiAPR_CHECK_SCTPAPR_CHECK_MCASTAC_SUBST(apr_tcp_nopush_flag)AC_SUBST(have_corkable_tcp)AC_SUBST(acceptfilter)AC_SUBST(have_sctp)AC_CHECK_FUNCS(set_h_errno)echo "${nl}Checking for IPv6 Networking support..."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 ] )case $host in *) broken_ipv6=0esacAC_SEARCH_LIBS(getaddrinfo, socket inet6)AC_SEARCH_LIBS(gai_strerror, socket inet6)AC_SEARCH_LIBS(getnameinfo, socket inet6)AC_CHECK_FUNCS(gai_strerror)APR_CHECK_WORKING_GETADDRINFOAPR_CHECK_NEGATIVE_EAIAPR_CHECK_WORKING_GETNAMEINFOAPR_CHECK_SOCKADDR_IN6APR_CHECK_SOCKADDR_STORAGEhave_ipv6="0"if test "$user_disabled_ipv6" = 1; then ipv6_result="no -- disabled by user"else if test "x$broken_ipv6" = "x0"; then 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 APR_CHECK_GETADDRINFO_ADDRCONFIG have_ipv6="1" ipv6_result="yes" else ipv6_result="no -- no getnameinfo" fi else ipv6_result="no -- no working getaddrinfo" fi else ipv6_result="no -- no sockaddr_in6" fi else ipv6_result="no -- the platform has known problems supporting IPv6" fifiAC_MSG_CHECKING(if APR supports IPv6)AC_MSG_RESULT($ipv6_result)AC_SUBST(have_ipv6)# hstrerror is only needed if IPv6 is not enabled,# so getaddrinfo/gai_strerror are not used.if test $have_ipv6 = 0; then AC_SEARCH_LIBS(hstrerror, resolv, [AC_DEFINE(HAVE_HSTRERROR, 1, [Define if hstrerror is present])])fidnl Check for langinfo su
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?