📄 configure.in
字号:
#! /bin/bash -norcdnl This file is an input file used by the GNU "autoconf" program todnl generate the file "configure", which is run during Tcl installationdnl to configure the system for the local environment.## RCS: @(#) $Id: configure.in,v 1.106 2003/02/15 02:16:33 hobbs Exp $AC_INIT(../generic/tcl.h)AC_PREREQ(2.13)TCL_VERSION=8.4TCL_MAJOR_VERSION=8TCL_MINOR_VERSION=4TCL_PATCH_LEVEL=".2"VERSION=${TCL_VERSION}#------------------------------------------------------------------------# Handle the --prefix=... option#------------------------------------------------------------------------if test "${prefix}" = "NONE"; then prefix=/usr/localfiif test "${exec_prefix}" = "NONE"; then exec_prefix=$prefixfi# libdir must be a fully qualified path and (not ${exec_prefix}/lib)eval libdir="$libdir"TCL_SRC_DIR=`cd $srcdir/..; pwd`#------------------------------------------------------------------------# Compress and/or soft link the manpages?#------------------------------------------------------------------------SC_CONFIG_MANPAGES#------------------------------------------------------------------------# 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=""fiAC_PROG_CCAC_HAVE_HEADERS(unistd.h limits.h)#------------------------------------------------------------------------# Threads support#------------------------------------------------------------------------SC_ENABLE_THREADS#------------------------------------------------------------------------# 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"; thenif test -n "$GCC"; then AC_MSG_CHECKING([if the compiler understands -pipe]) OLDCC="$CC" CC="$CC -pipe" AC_TRY_COMPILE(,, AC_MSG_RESULT(yes), CC="$OLDCC" AC_MSG_RESULT(no))fi fi#--------------------------------------------------------------------# Detect what compiler flags to set for 64-bit support.#--------------------------------------------------------------------SC_TCL_EARLY_FLAGSSC_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)AC_REPLACE_FUNCS(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)])AC_CHECK_FUNC(realpath, , [AC_DEFINE(NO_REALPATH)])#--------------------------------------------------------------------# 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#--------------------------------------------------------------------SC_MISSING_POSIX_HEADERS#---------------------------------------------------------------------------# 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_MSG_CHECKING([for fd_set in sys/types])AC_CACHE_VAL(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))AC_MSG_RESULT($tcl_cv_type_fd_set)tk_ok=$tcl_cv_type_fd_setif test $tcl_cv_type_fd_set = no; then AC_MSG_CHECKING([for fd_mask in sys/select]) AC_CACHE_VAL(tcl_cv_grep_fd_mask, AC_HEADER_EGREP(fd_mask, sys/select.h, tcl_cv_grep_fd_mask=present, tcl_cv_grep_fd_mask=missing)) AC_MSG_RESULT($tcl_cv_grep_fd_mask) if test $tcl_cv_grep_fd_mask = present; then AC_DEFINE(HAVE_SYS_SELECT_H) tk_ok=yes fifiif test $tk_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_BLKSIZEAC_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.#--------------------------------------------------------------------AC_MSG_CHECKING([proper strstr implementation])AC_TRY_RUN([extern int strstr();int main(){ exit(strstr("\0test", "test") ? 1 : 0);}], tcl_ok=yes, tcl_ok=no, tcl_ok=no)if test $tcl_ok = yes; then AC_MSG_RESULT(yes)else AC_MSG_RESULT([broken, using substitute]) LIBOBJS="$LIBOBJS strstr.o"fi#--------------------------------------------------------------------# Check for strtoul function. This is tricky because under some# versions of AIX strtoul returns an incorrect terminator# pointer for the string "0".#--------------------------------------------------------------------AC_CHECK_FUNC(strtoul, tcl_ok=1, tcl_ok=0)AC_TRY_RUN([extern int strtoul();int main(){ char *string = "0"; char *term; int value; value = strtoul(string, &term, 0); if ((value != 0) || (term != (string+1))) { exit(1); } exit(0);}], , tcl_ok=0, tcl_ok=0)if test "$tcl_ok" = 0; then test -n "$verbose" && echo " Adding strtoul.o." LIBOBJS="$LIBOBJS strtoul.o"fi#--------------------------------------------------------------------# Check for the strtod function. This is tricky because in some# versions of Linux strtod mis-parses strings starting with "+".#--------------------------------------------------------------------AC_CHECK_FUNC(strtod, tcl_ok=1, tcl_ok=0)AC_TRY_RUN([extern double strtod();int main(){ char *string = " +69"; char *term; double value; value = strtod(string, &term); if ((value != 69) || (term != (string+4))) { exit(1); } exit(0);}], , tcl_ok=0, tcl_ok=0)if test "$tcl_ok" = 0; then test -n "$verbose" && echo " Adding strtod.o." LIBOBJS="$LIBOBJS strtod.o"fi#--------------------------------------------------------------------# Under Solaris 2.4, strtod returns the wrong value for the# terminating character under some conditions. Check for this# and if the problem exists use a substitute procedure# "fixstrtod" that corrects the error.#--------------------------------------------------------------------SC_BUGGY_STRTOD#--------------------------------------------------------------------# Check for various typedefs and provide substitutes if# they don't exist.#--------------------------------------------------------------------AC_TYPE_MODE_TAC_TYPE_PID_TAC_TYPE_SIZE_TAC_TYPE_UID_TAC_MSG_CHECKING([for socklen_t])AC_CACHE_VAL(ac_cv_type_socklen_t,[AC_EGREP_CPP(changequote(<<,>>)dnl<<(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]>>dnlchangequote([,]),[ #include <sys/types.h> #include <sys/socket.h> #if STDC_HEADERS #include <stdlib.h> #include <stddef.h> #endif ], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])AC_MSG_RESULT($ac_cv_type_socklen_t)if test $ac_cv_type_socklen_t = no; then AC_DEFINE(socklen_t, unsigned)fi#--------------------------------------------------------------------# If a system doesn't have an opendir function (man, that's old!)# then we have to supply a different version of dirent.h which# is compatible with the substitute version of opendir that's# provided. This version only works with V7-style directories.#--------------------------------------------------------------------AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H)])#--------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -