diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/configure.in | 28 | ||||
-rw-r--r-- | unix/tcl.m4 | 58 |
2 files changed, 60 insertions, 26 deletions
diff --git a/unix/configure.in b/unix/configure.in index 0d7d8fc..3e9bfa1 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ 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. AC_INIT(../generic/tcl.h) -# RCS: @(#) $Id: configure.in,v 1.58 2000/05/03 00:15:10 hobbs Exp $ +# RCS: @(#) $Id: configure.in,v 1.59 2000/07/19 01:17:41 mo Exp $ TCL_VERSION=8.4 TCL_MAJOR_VERSION=8 @@ -60,18 +60,18 @@ fi #-------------------------------------------------------------------- # Check if Posix compliant getcwd exists, if not we'll use getwd. -AC_CHECK_FUNCS(getcwd, , AC_DEFINE(USEGETWD)) +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 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)) +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)]) #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is @@ -152,7 +152,7 @@ SC_TIME_HANDLER # in struct stat. But we might be able to use fstatfs instead. #-------------------------------------------------------------------- AC_STRUCT_ST_BLKSIZE -AC_CHECK_FUNC(fstatfs, , AC_DEFINE(NO_FSTATFS)) +AC_CHECK_FUNC(fstatfs, , [AC_DEFINE(NO_FSTATFS)]) #-------------------------------------------------------------------- # Some system have no memcmp or it does not work with 8 bit @@ -165,7 +165,7 @@ AC_FUNC_MEMCMP # 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)) +AC_CHECK_FUNC(memmove, , [AC_DEFINE(NO_MEMMOVE) AC_DEFINE(NO_STRING_H)]) #-------------------------------------------------------------------- # On some systems strstr is broken: it returns a pointer even @@ -262,7 +262,7 @@ AC_TYPE_UID_T # provided. This version only works with V7-style directories. #-------------------------------------------------------------------- -AC_CHECK_FUNC(opendir, , AC_DEFINE(USE_DIRENT2_H)) +AC_CHECK_FUNC(opendir, , [AC_DEFINE(USE_DIRENT2_H)]) #-------------------------------------------------------------------- # The check below checks whether <sys/wait.h> defines the type @@ -328,8 +328,10 @@ fi # declare it. #-------------------------------------------------------------------- -AC_CHECK_FUNC(BSDgettimeofday, AC_DEFINE(HAVE_BSDGETTIMEOFDAY), - AC_CHECK_FUNC(gettimeofday, , AC_DEFINE(NO_GETTOD))) +AC_CHECK_FUNC(BSDgettimeofday, + [AC_DEFINE(HAVE_BSDGETTIMEOFDAY)], [ + AC_CHECK_FUNC(gettimeofday, , [AC_DEFINE(NO_GETTOD)]) +]) AC_MSG_CHECKING([for gettimeofday declaration]) AC_EGREP_HEADER(gettimeofday, sys/time.h, AC_MSG_RESULT(present), [ AC_MSG_RESULT(missing) @@ -389,7 +391,7 @@ fi # LIBS="$LIBS -lsocket -lnsl" # AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) #fi -#AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) +#AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])]) #-------------------------------------------------------------------- # Look for libraries that we will need when compiling the Tcl shell diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 2454bd4..e33737a 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -223,6 +223,27 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [ AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) + + + # We need to find out if Tcl was compiled with thread + # support. We can not build an extension with thread + # support if Tcl is not built with thread support. + + AC_MSG_CHECKING([to see if Tcl was compiled with thread support]) + + if test "$TCL_THREADS" = "1"; then + # Define the following option so that they will + # be passed in the CFLAGS variable. We do not + # need to worry about THREADS_LIBS because that + # gets added to the LIBS variable. + + AC_MSG_RESULT([yes]) + AC_DEFINE(TCL_THREADS) + AC_DEFINE(_REENTRANT) + AC_DEFINE(_THREAD_SAFE) + else + AC_MSG_RESULT([no]) + fi ]) #------------------------------------------------------------------------ @@ -333,7 +354,10 @@ AC_DEFUN(SC_ENABLE_SHARED, [ #------------------------------------------------------------------------ # SC_ENABLE_THREADS -- # -# Specify if thread support should be enabled +# Specify if thread support should be enabled for Tcl. This +# macro can not be called from an extension's configure.in +# because it is not possible to build an extension with thread +# support if Tcl itself is not compiled with thread support. # # Arguments: # none @@ -349,6 +373,7 @@ AC_DEFUN(SC_ENABLE_SHARED, [ # Defines the following vars: # TCL_THREADS # _REENTRANT +# _THREAD_SAFE # #------------------------------------------------------------------------ @@ -357,6 +382,13 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_ARG_ENABLE(threads, [ --enable-threads build with threads], [tcl_ok=$enableval], [tcl_ok=no]) + # Make sure this macro is not getting include in an extensions + # configure.in by checking for the tcl.h include file. + + if test ! -f ${TCL_SRC_DIR}/generic/tcl.h ; then + AC_MSG_ERROR([The --enable-threads macro can only be used in Tcl's configure.in]) + fi + if test "$tcl_ok" = "yes"; then AC_MSG_RESULT(yes) TCL_THREADS=1 @@ -396,7 +428,7 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_CHECK_FUNCS(pthread_attr_setstacksize) else TCL_THREADS=0 - AC_MSG_RESULT(no (default)) + AC_MSG_RESULT([no (default)]) fi ]) @@ -1333,10 +1365,10 @@ closedir(d); fi AC_MSG_RESULT($tcl_ok) - AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H)) - AC_CHECK_HEADER(float.h, , AC_DEFINE(NO_FLOAT_H)) - AC_CHECK_HEADER(values.h, , AC_DEFINE(NO_VALUES_H)) - AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H)) + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)]) + AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) @@ -1355,8 +1387,8 @@ closedir(d); AC_DEFINE(NO_STRING_H) fi - AC_CHECK_HEADER(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H)) - AC_CHECK_HEADER(dlfcn.h, , AC_DEFINE(NO_DLFCN_H)) + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). @@ -1709,7 +1741,7 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [ #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H)) + AC_CHECK_HEADER(net/errno.h, [AC_DEFINE(HAVE_NET_ERRNO_H)]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. @@ -1732,16 +1764,16 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [ tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then - AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt, - LIBS="$LIBS -lsocket", tcl_checkBoth=1)) + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi - AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname, - [LIBS="$LIBS -lnsl"])) + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call SC_CONFIG_CFLAGS |