📄 configure.in
字号:
pid_t_fmt='#define APR_PID_T_FMT "hd"'elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_int"; then pid_t_fmt='#define APR_PID_T_FMT "d"'elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long"; then pid_t_fmt='#define APR_PID_T_FMT "ld"'elif test "$ac_cv_sizeof_pid_t" = "$ac_cv_sizeof_long_long"; then pid_t_fmt='#define APR_PID_T_FMT APR_INT64_T_FMT'else pid_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.case $host in s390*linux*) # uniquely, the 31-bit Linux/s390 uses "unsigned long int" # for size_t rather than "unsigned int": size_t_fmt="lu" ssize_t_fmt="ld" ;; *-os2*) size_t_fmt="lu" ;; *-solaris*) if test "$ac_cv_sizeof_long" = "8"; then pid_t_fmt='#define APR_PID_T_FMT "d"' else pid_t_fmt='#define APR_PID_T_FMT "ld"' fi ;; *aix4*|*aix5*) ssize_t_fmt="ld" size_t_fmt="lu" ;; *beos*) ssize_t_fmt="ld" size_t_fmt="ld" ;; *apple-darwin*) osver=`uname -r` case $osver in [[0-7]].*) ssize_t_fmt="d" ;; *) ssize_t_fmt="ld" ;; esac size_t_fmt="lu" ;;esacAPR_CHECK_TYPES_COMPATIBLE(ssize_t, int, [ssize_t_fmt="d"])APR_CHECK_TYPES_COMPATIBLE(ssize_t, long, [ssize_t_fmt="ld"])APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned int, [size_t_fmt="u"])APR_CHECK_TYPES_COMPATIBLE(size_t, unsigned long, [size_t_fmt="lu"])APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)AC_MSG_CHECKING([which format to use for apr_ssize_t])if test -n "$ssize_t_fmt"; then AC_MSG_RESULT(%$ssize_t_fmt)elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then ssize_t_fmt="d" AC_MSG_RESULT(%d)elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then ssize_t_fmt="ld" AC_MSG_RESULT(%ld)else AC_ERROR([could not determine the proper format for apr_ssize_t])fissize_t_fmt="#define APR_SSIZE_T_FMT \"$ssize_t_fmt\""APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)AC_MSG_CHECKING([which format to use for apr_size_t])if test -n "$size_t_fmt"; then AC_MSG_RESULT(%$size_t_fmt)elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then size_t_fmt="d" AC_MSG_RESULT(%d)elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then size_t_fmt="ld" AC_MSG_RESULT(%ld)else AC_ERROR([could not determine the proper format for apr_size_t])fisize_t_fmt="#define APR_SIZE_T_FMT \"$size_t_fmt\""APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], off_t, 8)if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # Enable LFS aprlfs=1 AC_CHECK_FUNCS([mmap64 sendfile64 sendfilev64 mkstemp64 readdir64_r])elif test "${ac_cv_sizeof_off_t}" != "${ac_cv_sizeof_size_t}"; then # unsure of using -gt above is as portable, can can't forsee where # off_t can legitimately be smaller than size_t aprlfs=1else aprlfs=0 fiAC_MSG_CHECKING([which type to use for apr_off_t])if test "${ac_cv_sizeof_off_t}${apr_cv_use_lfs64}" = "4yes"; then # LFS is go! off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' off_t_value='off64_t' off_t_strfn='apr_strtoi64'elif test "${ac_cv_sizeof_off_t}x${ac_cv_sizeof_long}" = "4x4"; then # Special case: off_t may change size with _FILE_OFFSET_BITS # on 32-bit systems with LFS support. To avoid compatibility # issues when other packages do define _FILE_OFFSET_BITS, # hard-code apr_off_t to long. off_t_value=long off_t_fmt='#define APR_OFF_T_FMT "ld"' off_t_strfn='strtol'elif test "$ac_cv_type_off_t" = "yes"; then off_t_value=off_t # off_t is more commonly a long than an int; prefer that case # where int and long are the same size. if test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long"; then off_t_fmt='#define APR_OFF_T_FMT "ld"' off_t_strfn='strtol' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_int"; then off_t_fmt='#define APR_OFF_T_FMT "d"' off_t_strfn='strtoi' elif test "$ac_cv_sizeof_off_t" = "$ac_cv_sizeof_long_long"; then off_t_fmt='#define APR_OFF_T_FMT APR_INT64_T_FMT' off_t_strfn='apr_strtoi64' else AC_ERROR([could not determine the size of off_t]) fielse # Fallback on int off_t_value=apr_int32_t off_t_fmt=d off_t_strfn='strtoi'fiAC_MSG_RESULT($off_t_value)# Regardless of whether _LARGEFILE64_SOURCE is used, on 32-bit# platforms _FILE_OFFSET_BITS will affect the size of ino_t and hence# the build-time ABI may be different from the apparent ABI when using# APR with another package which *does* define _FILE_OFFSET_BITS.# (Exactly as per the case above with off_t where LFS is *not* used)## To be safe, hard-code apr_ino_t as 'unsigned long' iff that is# exactly the size of ino_t here; otherwise use ino_t as existing# releases did. To be correct, apr_ino_t should have been made an# ino64_t as apr_off_t is off64_t, but this can't be done now without# breaking ABI.ino_t_value=ino_tif test "$ac_cv_sizeof_long" = "4"; then APR_CHECK_TYPES_COMPATIBLE(ino_t, unsigned long, ino_t_value="unsigned long")fiAC_MSG_NOTICE([using $ino_t_value for ino_t])# Checks for endiannessAC_C_BIGENDIANif test $ac_cv_c_bigendian = yes; then bigendian=1else bigendian=0fiAPR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>#include <sys/uio.h>],struct iovec,0)if test "$ac_cv_sizeof_struct_iovec" = "0"; then have_iovec=0else have_iovec=1fiAC_SUBST(voidp_size)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(uint64_t_fmt) AC_SUBST(uint64_t_hex_fmt) AC_SUBST(ssize_t_fmt) AC_SUBST(size_t_fmt)AC_SUBST(off_t_fmt) AC_SUBST(pid_t_fmt)AC_SUBST(int64_literal) AC_SUBST(uint64_literal) AC_SUBST(stdint) AC_SUBST(bigendian)AC_SUBST(aprlfs)AC_SUBST(have_iovec)AC_SUBST(ino_t_value)dnl ----------------------------- Checking for string functionsAC_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_CHECK_FUNC($int64_strfn, have_int64_strfn="1", have_int64_strfn="0")dnl ----------------------------- We have a fallback positionif test "$have_int64_strfn" = "0" && test "$int64_strfn" = "strtoll"; then int64_strfn="strtoq" AC_CHECK_FUNC(strtoq, [have_int64_strfn=1], [have_int64_strfn=0])fiif test "$have_int64_strfn" = "1"; then AC_DEFINE_UNQUOTED(APR_INT64_STRFN, [$int64_strfn], [Define as function which can be used for conversion of strings to apr_int64_t])fiAC_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)if test "$off_t_strfn" = "apr_strtoi64" && test "$have_int64_strfn" = "1"; then off_t_strfn=$int64_strfnfiAC_DEFINE_UNQUOTED(APR_OFF_T_STRFN, [$off_t_strfn], [Define as function used for conversion of strings to apr_off_t])dnl ----------------------------- Checking for DSO supportecho "${nl}Checking for DSO..."AC_ARG_ENABLE(dso, [ --disable-dso Disable DSO support ], [if test "x$enableval" = "xyes"; then dsotype=any else dsotype=$enableval fi ], [dsotype=any])if test "$dsotype" = "any"; then if test "$dsotype" = "any"; then case $host in *darwin[[0-8]]\.*) # Original Darwin, not for 9.0!: AC_CHECK_FUNC(NSLinkModule, [dsotype=dyld]);; *-hpux[[1-9]]\.*|*-hpux1[[01]]*) # shl is specific to hpux(?), and is suboptimal for 64 bit builds, # and most unlikely to be the choice of 12.x developers. AC_CHECK_LIB(dld, shl_load, [have_shl=1]) if test "$ac_cv_sizeof_voidp$have_shl" = "41"; then dsotype=shl; APR_ADDTO(LIBS,-ldld) fi;; *mingw*|*-os2*) # several 'other's below probably belong up here. If they always # use a platform implementation and shouldn't test the dlopen/dlfcn # features, then bring them up here. # But if they -should- optionally use dlfcn, and/or need the config # detection of dlopen/dlsym, do not move them up. dsotype=other ;; esac fi # Normal POSIX: if test "$dsotype" = "any"; then AC_CHECK_FUNC(dlopen, [dsotype=dlfcn]) fi if test "$dsotype" = "any"; then AC_CHECK_LIB(dl, dlopen, [dsotype=dlfcn; APR_ADDTO(LIBS,-ldl)]) fi if test "$dsotype" = "dlfcn"; then # ReliantUnix has dlopen() in libc but dlsym() in libdl :( AC_CHECK_FUNC(dlsym, [], [AC_CHECK_LIB(dl, dlsym, [APR_ADDTO(LIBS, -ldl)], [dsotype=any echo "Weird: dlopen() was found but dlsym() was not found!"])]) fi if test "$dsotype" = "any"; then # BeOS: AC_CHECK_LIB(root, load_image, [dsotype=other]) fi # Everything else: if test "$dsotype" = "any"; then case $host in *os390|*os400|*-aix*) # Some -aix5 will use dl, no hassles. Keep that pattern here. dsotype=other ;; *-hpux*) if test "$have_shl" = "1"; then dsotype=shl; APR_ADDTO(LIBS,-ldld) fi;; esac fifiif test "$dsotype" = "any"; then AC_MSG_ERROR([Could not detect suitable DSO implementation])elif test "$dsotype" = "no"; then aprdso="0"else case "$dsotype" in dlfcn) AC_DEFINE(DSO_USE_DLFCN, 1, [Define if DSO support uses dlfcn.h]);; shl) AC_DEFINE(DSO_USE_SHL, 1, [Define if DSO support uses shl_load]);; dyld) AC_DEFINE(DSO_USE_DYLD, 1, [Define if DSO support uses dyld.h]);; other) ;; # Use whatever is in dso/OSDIR *) AC_MSG_ERROR([Unknown DSO implementation "$dsotype"]);; esac aprdso="1" apr_modules="$apr_modules dso"fiAC_SUBST(aprdso)dnl ----------------------------- Checking for Processesecho "${nl}Checking for Processes..."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) if test -z "$have_proc_invoked"; then have_proc_invoked="0"fiAC_SUBST(have_proc_invoked)AC_MSG_CHECKING(for Variable Length Arrays)APR_TRY_COMPILE_NO_WARNING([],[ int foo[argc]; foo[0] = 0;], vla_msg=yes, vla_msg=no )AC_MSG_RESULT([$vla_msg])if test "$vla_msg" = "yes"; then AC_DEFINE(HAVE_VLA, 1, [Define if C compiler supports VLA])fiAC_CACHE_CHECK(struct rlimit,ac_cv_struct_rlimit,[AC_TRY_RUN([#include <sys/types.h>#include <sys/time.h>#include <sys/resource.h>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=0test "x$ac_cv_struct_rlimit" = xyes && struct_rlimit=1AC_SUBST(struct_rlimit)dnl ----------------------------- Checking for Locking Characteristics echo "${nl}Checking for Locking..."AC_CHECK_FUNCS(semget semctl flock)AC_CHECK_HEADERS(semaphore.h OS.h)AC_SEARCH_LIBS(sem_open, rt)AC_CHECK_FUNCS(sem_close sem_unlink sem_post sem_wait create_sem)# Some systems return ENOSYS from sem_open.AC_CACHE_CHECK(for working sem_open,ac_cv_func_sem_open,[AC_TRY_RUN([#include <errno.h>#include <stdlib.h>#include <fcntl.h>#include <semaphore.h>#ifndef SEM_FAILED#define SEM_FAILED (-1)#endifmain(){ sem_t *psem; const char *sem_name = "/apr_autoconf"; psem = sem_open(sem_name, O_CREAT, 0644, 1); if (psem == (sem_t *)SEM_FAILED) { exit(1); } sem_close(psem); psem = sem_open(sem_name, O_CREAT | O_EXCL, 0644, 1); if (psem != (sem_t *)SEM_FAILED) { sem_close(psem); exit(1); } sem_unlink(sem_name); exit(0);}], [ac_cv_func_sem_open=yes], [ac_cv_func_sem_open=no],[ac_cv_func_sem_open=no])])# 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 <sys/types.h>#include <sys/ipc.h>#include <sys/sem.h>],[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)# 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) # Some systems have setpshared and define PROCESS_SHARED, but don't # really support PROCESS_SHARED locks. So, we must validate that we # can go through the steps without receiving some sort of system error. # Linux and older versions of AIX have this problem. APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED func:pthread_mutexattr_setpshared, [ AC_CACHE_CHECK([for working PROCESS_SHARED locks], apr_cv_process_shared_works, [ AC_TRY_RUN([#include <sys/types.h>#include <pthread.h> int main() {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -