📄 configure.ac
字号:
dnl ##dnl ## GNU Pth - The GNU Portable Threadsdnl ## Copyright (c) 1999-2004 Ralf S. Engelschall <rse@engelschall.com>dnl ##dnl ## This file is part of GNU Pth, a non-preemptive thread schedulingdnl ## library which can be found at http://www.gnu.org/software/pth/.dnl ##dnl ## This library is free software; you can redistribute it and/ordnl ## modify it under the terms of the GNU Lesser General Publicdnl ## License as published by the Free Software Foundation; eitherdnl ## version 2.1 of the License, or (at your option) any later version.dnl ##dnl ## This library is distributed in the hope that it will be useful,dnl ## but WITHOUT ANY WARRANTY; without even the implied warranty ofdnl ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUdnl ## Lesser General Public License for more details.dnl ##dnl ## You should have received a copy of the GNU Lesser General Publicdnl ## License along with this library; if not, write to the Free Softwarednl ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307dnl ## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.dnl ##dnl ## configure.ac: Pth Autoconf specificationdnl ##dnl # ``Programming in Bourne-Shelldnl # is a higher form of masochism.''dnl # -- Unknowndnl ##dnl ## PROLOGdnl ##dnl # standard Autoconf prologAC_PREREQ(2.52)dnlAC_REVISION([1.0])dnl # autoconf initializationAC_INIT(README)AC_ENABLESUBDIRAC_SRCDIR_PREFIX(srcdir_prefix)AC_HEADLINE(dnlGNU Pth, Portable Threads, dnlPTH_VERSION, pth_vers.c, dnl[Copyright (c) 1999-2004 Ralf S. Engelschall <rse@engelschall.com>])AC_CONFIG_PARAM(config.param)AC_CONFIG_HEADER(pth_acdef.h)dnlAC_PREFIX_DEFAULT(/usr/local)AC_PLATFORM(PLATFORM)dnl ##dnl ## BUILD TOOLSdnl ##AC_MSG_PART(Build Tools)AC_PROG_CCAC_PROG_CPPAC_PROG_EGREPAC_SET_MAKEAC_CHECK_DEBUGGINGAC_CHECK_PROFILINGAC_CHECK_OPTIMIZEif test -f "$srcdir/ltmain.sh"; then case "$PLATFORM" in # Solaris 2.7/x86 is slightly broken *-pc-solaris2.[[78]] [)] enable_shared=no ;; esac sinclude(libtool.m4) AC_PROG_LIBTOOLelse dnl # only for stripped down Pth source tree AC_CHECK_PROG(AR, ar, ar) AC_PROG_RANLIBfidnl ## Support for some special platform/compiler optionscase "$PLATFORM:$CC" in *-sun-solaris2*:cc ) # shut-up harmless warnings caused by do-while macros on Solaris test ".$ac_cv_prog_gcc" = ".no" && CFLAGS="$CFLAGS -w" ;; *-*-sysv*uw[[27]]*:cc ) # shut-up harmless warnings caused by do-while macros on UnixWare CFLAGS="$CFLAGS -w" ;; *-hp-hpux*:cc ) # HPUX needs a few special options to find its ANSI C brain CFLAGS="$CFLAGS -Ae -O" ;; *-hp-hpux*:CC ) # HPUX outputs useless warnings CFLAGS="$CFLAGS -w" ;; *-sgi-irix6.2:cc ) # shut-up warnings caused by IRIX brain-dead 32/64 bit stuff LDFLAGS="$LDFLAGS -woff 85 -Wl,-woff,84 -Wl,-woff,85" ;; *-sgi-irix6.5.[[2-9]]:cc ) # since IRIX 6.5.2 the C compiler is smart enough, # but the linker is still complaining, of course LDFLAGS="$LDFLAGS -woff 84,85,134" ;; *-sgi-irix6.5:cc ) # shut-up warnings caused by IRIX brain-dead 32/64 bit stuff CFLAGS="$CFLAGS -woff 1110,1048" LDFLAGS="$LDFLAGS -woff 84,85,134" ;; *-dec-osf4*:cc ) # make sure the standard compliant functions are used on Tru64/OSF1 4.x CFLAGS="$CFLAGS -std" ;; *-dec-osf5*:cc ) # make sure the standard compliant functions are used on Tru64/OSF1 5.x CFLAGS="$CFLAGS -std -D_XOPEN_SOURCE_EXTENDED" ;; *-*-isc*:* ) # ISC is brain-dead and needs a bunch of options to find its brain CPPFLAGS="$CPPFLAGS -D_POSIX_SOURCE"; LIBS="$LIBS -lcposix -linet"; ;; *-*-aix4.1*:cc ) # AIX 4.1.x' cc complains about our use of "volatile" CPPFLAGS="$CPPFLAGS '-Dvolatile=/**/'"; ;;esacdnl ##dnl ## MANDATORY PLATFORM ENVIRONMENTdnl ##AC_MSG_PART(Mandatory Platform Environment)dnl # check for standard headersAC_HEADER_STDCAC_HAVE_HEADERS(dnl stdio.h stdlib.h stdarg.h string.h signal.h unistd.h setjmp.h fcntl.h dnl errno.h sys/types.h sys/time.h sys/wait.h sys/stat.h sys/socket.h)AC_CHECK_FUNCS(dnl gettimeofday select sigaction sigprocmask sigpending sigsuspend)AC_BEGIN_DECISION([mandatory system headers and functions])AC_IFALLYES(dnl header:stdio.h header:stdlib.h header:stdarg.h header:string.h dnl header:signal.h header:unistd.h header:setjmp.h header:fcntl.h header:errno.h dnl header:sys/types.h header:sys/time.h header:sys/wait.h header:sys/stat.h header:sys/socket.h dnl func:gettimeofday func:select func:sigaction func:sigprocmask dnl func:sigpending func:sigsuspend, AC_DECIDE(fine, [all fine]))AC_END_DECISIONdnl ##dnl ## OPTIONAL PLATFORM ENVIRONMENTdnl ##AC_MSG_PART(Optional Platform Environment)dnl # check for the number of signalsAC_CHECK_NSIG(PTH_NSIG)dnl # check for size of fd_set (FDSETSIZE)AC_CHECK_FDSETSIZE(PTH_FDSETSIZE)dnl # check whether poll(2)'s input stuff has to be fakedAC_CHECK_FUNCS(poll)AC_CHECK_DEFINE(POLLIN, poll.h)AC_MSG_CHECKING(whether poll(2) facility has to be faked)AC_IFALLYES(func:poll define:POLLIN, PTH_FAKE_POLL=0, PTH_FAKE_POLL=1)if test .$PTH_FAKE_POLL = .1; then msg="yes"else msg="no"fiAC_SUBST(PTH_FAKE_POLL)AC_MSG_RESULT([$msg])dnl # check for readv/writev environmentAC_HAVE_HEADERS(sys/uio.h)AC_CHECK_FUNCS(readv writev)AC_MSG_CHECKING(whether readv(2)/writev(2) facility has to be faked)AC_IFALLYES(func:readv func:writev header:sys/uio.h, PTH_FAKE_RWV=0, PTH_FAKE_RWV=1)if test .$PTH_FAKE_RWV = .1; then msg="yes"else msg="no"fiAC_SUBST(PTH_FAKE_RWV)AC_MSG_RESULT([$msg])dnl # check for various other functions which would be nice to haveAC_CHECK_FUNCS(usleep strerror)dnl # check for various other headers which we might needAC_HAVE_HEADERS(sys/resource.h net/errno.h paths.h)dnl # at least the test programs need some socket stuffAC_CHECK_LIB(nsl, gethostname)if test ".`echo $LIBS | grep nsl`" = .; then AC_CHECK_LIB(nsl, gethostbyname)fiAC_CHECK_LIB(socket, accept)dnl # check whether we've to use a non-standard #include <sys/select.h> to getdnl # the definition for fd_set under AIX and other brain-dead platforms.AC_HAVE_HEADERS(sys/select.h)EXTRA_INCLUDE_SYS_SELECT_H="#include <sys/select.h>"if test ".$ac_cv_header_sys_select_h" != .yes; then EXTRA_INCLUDE_SYS_SELECT_H="/* $EXTRA_INCLUDE_SYS_SELECT_H */"fiAC_SUBST(EXTRA_INCLUDE_SYS_SELECT_H)dnl # check whether we've to define sig_atomic_tAC_CHECK_TYPEDEF(sig_atomic_t, signal.h)FALLBACK_SIG_ATOMIC_T="typedef int sig_atomic_t;"if test ".$ac_cv_typedef_sig_atomic_t" = .yes; then FALLBACK_SIG_ATOMIC_T="/* $FALLBACK_SIG_ATOMIC_T */"fiAC_SUBST(FALLBACK_SIG_ATOMIC_T)dnl # check whether we've to define pid_tAC_CHECK_TYPEDEF(pid_t, sys/types.h)FALLBACK_PID_T="typedef int pid_t;"if test ".$ac_cv_typedef_pid_t" = .yes; then FALLBACK_PID_T="/* $FALLBACK_PID_T */"fiAC_SUBST(FALLBACK_PID_T)dnl # check whether we've to define size_tAC_CHECK_TYPEDEF(size_t, stdlib.h)FALLBACK_SIZE_T="typedef unsigned int size_t;"if test ".$ac_cv_typedef_size_t" = .yes; then FALLBACK_SIZE_T="/* $FALLBACK_SIZE_T */"fiAC_SUBST(FALLBACK_SIZE_T)dnl # check whether we've to define ssize_tAC_CHECK_TYPEDEF(ssize_t, sys/types.h)FALLBACK_SSIZE_T="typedef unsigned int ssize_t;"if test ".$ac_cv_typedef_ssize_t" = .yes; then FALLBACK_SSIZE_T="/* $FALLBACK_SSIZE_T */"fiAC_SUBST(FALLBACK_SSIZE_T)dnl # check whether we've to define off_tAC_CHECK_TYPEDEF(off_t, sys/types.h)FALLBACK_OFF_T="typedef int off_t;"if test ".$ac_cv_typedef_off_t" = .yes; then FALLBACK_OFF_T="/* $FALLBACK_OFF_T */"fiAC_SUBST(FALLBACK_OFF_T)dnl # check whether stack_t exists instead of sigaltstackAC_CHECK_TYPEDEF(stack_t, signal.h)dnl # check whether ss_base instead of ss_sp attribute existsAC_CHECK_STRUCTATTR(ss_base, sigaltstack, sys/signal.h)AC_CHECK_STRUCTATTR(ss_sp, sigaltstack, sys/signal.h)dnl # check for gettimeofday() variantAC_MSG_CHECKING(for a single-argument based gettimeofday)cross_compile=noAC_TRY_COMPILE([#include <sys/types.h>#include <sys/time.h>#include <unistd.h>],[struct timeval tv;(void)gettimeofday(&tv);],msg="yes",msg="no")case $PLATFORM in *-*-aix4* ) msg="no" ;; # on AIX the compiler test doesn't work *-*-isc* ) msg="no" ;; # on ISC the compiler test doesn't workesacif test ".$msg" = .yes; then AC_DEFINE(HAVE_GETTIMEOFDAY_ARGS1, 1, [define if gettimeofday(2) wants a single-argument only])fiAC_MSG_RESULT([$msg])dnl # check for struct timespecAC_MSG_CHECKING(for struct timespec)cross_compile=noAC_TRY_COMPILE([#include <time.h>#include <sys/time.h>],[struct timespec ts;],msg="yes",msg="no")if test ".$msg" = .yes; then AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, [define if exists "struct timespec"])fiAC_MSG_RESULT([$msg])dnl # check for network/socket size typeAC_CHECK_SOCKLENTYPE([FALLBACK_SOCKLEN_T="typedef ${ac_type} socklen_t;"if test ".$ac_type" = ".socklen_t"; then FALLBACK_SOCKLEN_T="/* $FALLBACK_SOCKLEN_T */"fiAC_SUBST(FALLBACK_SOCKLEN_T)])dnl # check for filedescriptor number typeAC_CHECK_NFDSTYPE([FALLBACK_NFDS_T="typedef ${ac_type} nfds_t;"if test ".$ac_type" = ".nfds_t"; then FALLBACK_NFDS_T="/* $FALLBACK_NFDS_T */"fiAC_SUBST(FALLBACK_NFDS_T)])dnl # check for 64-bit types (for pth_snprintf.c)AC_CHECK_LONGLONGAC_CHECK_LONGDOUBLEdnl ##dnl ## MACHINE CONTEXT IMPLEMENTATIONdnl ##AC_MSG_PART(Machine Context Implementation)dnl #dnl # 1. determine possibilitiesdnl #dnl # check for MCSC methodAC_CHECK_HEADER(ucontext.h,,, [#include <sys/types.h>])AC_CHECK_FUNCS(makecontext swapcontext getcontext setcontext)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -