configure.in
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:28k
- #! /bin/bash -norc
- dnl This file is an input file used by the GNU "autoconf" program to
- dnl generate the file "configure", which is run during Tcl installation
- dnl to configure the system for the local environment.
- #
- # RCS: @(#) $Id: configure.in,v 1.106.2.42 2008/02/06 15:25:27 dgp Exp $
- AC_INIT(../generic/tcl.h)
- AC_PREREQ(2.13)
- TCL_VERSION=8.4
- TCL_MAJOR_VERSION=8
- TCL_MINOR_VERSION=4
- TCL_PATCH_LEVEL=".18"
- VERSION=${TCL_VERSION}
- #------------------------------------------------------------------------
- # Handle the --prefix=... option
- #------------------------------------------------------------------------
- if test "${prefix}" = "NONE"; then
- prefix=/usr/local
- fi
- if test "${exec_prefix}" = "NONE"; then
- exec_prefix=$prefix
- fi
- # Make sure srcdir is fully qualified!
- srcdir=`cd $srcdir ; pwd`
- TCL_SRC_DIR=`cd $srcdir/..; pwd`
- #------------------------------------------------------------------------
- # Compress and/or soft link the manpages?
- #------------------------------------------------------------------------
- SC_CONFIG_MANPAGES([tcl])
- #------------------------------------------------------------------------
- # Standard compiler checks
- #------------------------------------------------------------------------
- # If the user did not set CFLAGS, set it now to keep
- # the AC_PROG_CC macro from adding "-g -O2".
- if test "${CFLAGS+set}" != "set" ; then
- CFLAGS=""
- fi
- AC_PROG_CC
- #--------------------------------------------------------------------
- # Supply substitutes for missing POSIX header files. Special notes:
- # - stdlib.h doesn't define strtol, strtoul, or
- # strtod insome versions of SunOS
- # - some versions of string.h don't declare procedures such
- # as strstr
- # Do this early, otherwise an autoconf bug throws errors on configure
- #--------------------------------------------------------------------
- SC_MISSING_POSIX_HEADERS
- #------------------------------------------------------------------------
- # If we're using GCC, see if the compiler understands -pipe. If so, use it.
- # It makes compiling go faster. (This is only a performance feature.)
- #------------------------------------------------------------------------
- if test -z "$no_pipe" && test -n "$GCC"; then
- AC_CACHE_CHECK([if the compiler understands -pipe],
- tcl_cv_cc_pipe, [
- hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe"
- AC_TRY_COMPILE(,, tcl_cv_cc_pipe=yes, tcl_cv_cc_pipe=no)
- CFLAGS=$hold_cflags])
- if test $tcl_cv_cc_pipe = yes; then
- CFLAGS="$CFLAGS -pipe"
- fi
- fi
- #------------------------------------------------------------------------
- # Threads support
- #------------------------------------------------------------------------
- SC_ENABLE_THREADS
- #--------------------------------------------------------------------
- # Look for libraries that we will need when compiling the Tcl shell
- #--------------------------------------------------------------------
- SC_TCL_LINK_LIBS
- # Add the threads support libraries
- LIBS="$LIBS$THREADS_LIBS"
- SC_ENABLE_SHARED
- #--------------------------------------------------------------------
- # The statements below define a collection of compile flags. This
- # macro depends on the value of SHARED_BUILD, and should be called
- # after SC_ENABLE_SHARED checks the configure switches.
- #--------------------------------------------------------------------
- SC_CONFIG_CFLAGS
- SC_ENABLE_SYMBOLS
- TCL_DBGX=${DBGX}
- #--------------------------------------------------------------------
- # Detect what compiler flags to set for 64-bit support.
- #--------------------------------------------------------------------
- SC_TCL_EARLY_FLAGS
- SC_TCL_64BIT_FLAGS
- #--------------------------------------------------------------------
- # Check endianness because we can optimize comparisons of
- # Tcl_UniChar strings to memcmp on big-endian systems.
- #--------------------------------------------------------------------
- AC_C_BIGENDIAN
- #--------------------------------------------------------------------
- # Supply substitutes for missing POSIX library procedures, or
- # set flags so Tcl uses alternate procedures.
- #--------------------------------------------------------------------
- # Check if Posix compliant getcwd exists, if not we'll use getwd.
- AC_CHECK_FUNCS(getcwd, , [AC_DEFINE(USEGETWD)])
- # Nb: if getcwd uses popen and pwd(1) (like SunOS 4) we should really
- # define USEGETWD even if the posix getcwd exists. Add a test ?
- AC_REPLACE_FUNCS(opendir strstr strtol strtoll strtoull tmpnam waitpid)
- AC_CHECK_FUNC(strerror, , [AC_DEFINE(NO_STRERROR)])
- AC_CHECK_FUNC(getwd, , [AC_DEFINE(NO_GETWD)])
- AC_CHECK_FUNC(wait3, , [AC_DEFINE(NO_WAIT3)])
- AC_CHECK_FUNC(uname, , [AC_DEFINE(NO_UNAME)])
- if test "`uname -s`" = "Darwin" && test "${TCL_THREADS}" = 1 &&
- test "`uname -r | awk -F. '{print [$]1}'`" -lt 7; then
- # prior to Darwin 7, realpath is not threadsafe, so don't
- # use it when threads are enabled, c.f. bug # 711232
- ac_cv_func_realpath=no
- fi
- AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH)])
- #--------------------------------------------------------------------
- # Look for thread-safe variants of some library functions.
- #--------------------------------------------------------------------
- if test "${TCL_THREADS}" = 1; then
- SC_TCL_GETPWUID_R
- SC_TCL_GETPWNAM_R
- SC_TCL_GETGRGID_R
- SC_TCL_GETGRNAM_R
- if test "`uname -s`" = "Darwin" &&
- test "`uname -r | awk -F. '{print [$]1}'`" -gt 5; then
- # Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
- # are actually MT-safe as they always return pointers
- # from the TSD instead of the static storage.
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME)
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR)
- elif test "`uname -s`" = "HP-UX" &&
- test "`uname -r|sed -e 's|B.||' -e 's|..*$||'`" -gt 10; then
- # Starting with HPUX 11.00 (we believe), gethostbyX
- # are actually MT-safe as they always return pointers
- # from TSD instead of static storage.
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME)
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR)
- else
- SC_TCL_GETHOSTBYNAME_R
- SC_TCL_GETHOSTBYADDR_R
- fi
- fi
- #---------------------------------------------------------------------------
- # Determine which interface to use to talk to the serial port.
- # Note that #include lines must begin in leftmost column for
- # some compilers to recognize them as preprocessor directives.
- #---------------------------------------------------------------------------
- SC_SERIAL_PORT
- #--------------------------------------------------------------------
- # Include sys/select.h if it exists and if it supplies things
- # that appear to be useful and aren't already in sys/types.h.
- # This appears to be true only on the RS/6000 under AIX. Some
- # systems like OSF/1 have a sys/select.h that's of no use, and
- # other systems like SCO UNIX have a sys/select.h that's
- # pernicious. If "fd_set" isn't defined anywhere then set a
- # special flag.
- #--------------------------------------------------------------------
- AC_CACHE_CHECK([for fd_set in sys/types], tcl_cv_type_fd_set, [
- AC_TRY_COMPILE([#include <sys/types.h>],[fd_set readMask, writeMask;],
- tcl_cv_type_fd_set=yes, tcl_cv_type_fd_set=no)])
- tcl_ok=$tcl_cv_type_fd_set
- if test $tcl_ok = no; then
- AC_CACHE_CHECK([for fd_mask in sys/select], tcl_cv_grep_fd_mask, [
- AC_EGREP_HEADER(fd_mask, sys/select.h,
- tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)])
- if test $tcl_cv_grep_fd_mask = present; then
- AC_DEFINE(HAVE_SYS_SELECT_H)
- tcl_ok=yes
- fi
- fi
- if test $tcl_ok = no; then
- AC_DEFINE(NO_FD_SET)
- fi
- #------------------------------------------------------------------------------
- # Find out all about time handling differences.
- #------------------------------------------------------------------------------
- SC_TIME_HANDLER
- #--------------------------------------------------------------------
- # Some systems (e.g., IRIX 4.0.5) lack the st_blksize field
- # in struct stat. But we might be able to use fstatfs instead.
- #--------------------------------------------------------------------
- AC_STRUCT_ST_BLKSIZE
- AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS)])
- #--------------------------------------------------------------------
- # Some system have no memcmp or it does not work with 8 bit
- # data, this checks it and add memcmp.o to LIBOBJS if needed
- #--------------------------------------------------------------------
- AC_FUNC_MEMCMP
- #--------------------------------------------------------------------
- # Some system like SunOS 4 and other BSD like systems
- # have no memmove (we assume they have bcopy instead).
- # {The replacement define is in compat/string.h}
- #--------------------------------------------------------------------
- AC_CHECK_FUNC(memmove, , [AC_DEFINE(NO_MEMMOVE) AC_DEFINE(NO_STRING_H)])
- #--------------------------------------------------------------------
- # On some systems strstr is broken: it returns a pointer even
- # even if the original string is empty.
- #--------------------------------------------------------------------
- dnl only run if AC_REPLACE_FUNCS(strstr) hasn't already added strstr.o
- if test "x${ac_cv_func_strstr}" = "xyes"; then
- AC_CACHE_CHECK([proper strstr implementation], tcl_cv_strstr_unbroken, [
- AC_TRY_RUN([
- extern int strstr();
- int main()
- {
- exit(strstr("