diff options
Diffstat (limited to 'unix/configure.in')
-rw-r--r-- | unix/configure.in | 140 |
1 files changed, 122 insertions, 18 deletions
diff --git a/unix/configure.in b/unix/configure.in index c8f25a4..1e339a4 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -2,12 +2,12 @@ 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.30 1999/03/25 22:47:54 welch Exp $ +# RCS: @(#) $Id: configure.in,v 1.31 1999/04/16 00:48:03 stanton Exp $ -TCL_VERSION=8.0 +TCL_VERSION=8.1 TCL_MAJOR_VERSION=8 -TCL_MINOR_VERSION=0 -TCL_PATCH_LEVEL=".5" +TCL_MINOR_VERSION=1 +TCL_PATCH_LEVEL=b3 VERSION=${TCL_VERSION} if test "${prefix}" = "NONE"; then @@ -29,6 +29,25 @@ AC_SUBST(CC) fi AC_C_CROSS +# Threads support +AC_ARG_ENABLE(threads,[ --enable-threads enable Threads support],,enableval="no") + +if test "$enableval" = "yes"; then + AC_MSG_RESULT(Will compile with Threads support) + AC_DEFINE(TCL_THREADS) + AC_DEFINE(_REENTRANT) + + AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + else + AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") + fi +else + AC_MSG_RESULT(Will compile without Threads support (normal)) +fi + # set the warning flags depending on whether or not we are using gcc if test "${GCC}" = "yes" ; then CFLAGS_WARNING="-Wall -Wconversion" @@ -36,6 +55,19 @@ else CFLAGS_WARNING="" fi +#----------------------------- +# 64-bit support +#----------------------------- + +AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support],,enableval="no") + +if test "$enableval" = "yes"; then + AC_MSG_RESULT(Will compile with 64bit support) + do64bit=yes +else + do64bit=no +fi + #------------------------------------------------------------------------------ # 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.) @@ -70,6 +102,7 @@ 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 @@ -144,12 +177,16 @@ fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) +# See also memmove check below for a place where NO_STRING_H can be +# set and why. if test $tcl_ok = 0; then 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_HAVE_HEADERS(unistd.h) + +# OS/390 lacks sys/param.h (and doesn't need it, by chance). +AC_HAVE_HEADERS(unistd.h sys/param.h) #--------------------------------------------------------------------------- # Determine which interface to use to talk to the serial port. @@ -294,9 +331,23 @@ fi #-------------------------------------------------------------------- # Some systems (e.g., IRIX 4.0.5) lack the st_blksize field -# in struct stat. +# 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 @@ -592,6 +643,10 @@ if test "$tcl_checkBoth" = 1; then fi AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"])) +# Add the threads support libraries + +LIBS="$LIBS$THREADS_LIBS" + #-------------------------------------------------------------------- # The statements below define a collection of symbols related to # dynamic loading and shared libraries: @@ -687,6 +742,7 @@ AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Step 3: set configuration options based on system name and version. +do64bit_ok=no fullSrcDir=`cd $srcdir; pwd` EXTRA_CFLAGS="" TCL_EXPORT_FILE_SUFFIX="" @@ -714,7 +770,7 @@ case $system in ;; AIX-*) SHLIB_CFLAGS="" - SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o tclLoadAix.o" @@ -724,7 +780,7 @@ case $system in TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' ;; - BSD/OS-2.1*|BSD/OS-3*|BSD/OS-4*) + BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' @@ -734,6 +790,16 @@ case $system in LD_FLAGS="" LD_SEARCH_FLAGS="" ;; + BSD/OS-4.*) + SHLIB_CFLAGS="-export-dynamic -fPIC" + SHLIB_LD="cc -shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + LD_FLAGS="-export-dynamic" + LD_SEARCH_FLAGS="" + ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="cc -G" @@ -771,7 +837,7 @@ case $system in IRIX-5.*|IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" - SHLIB_LD_LIBS='${LIBS}' + SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" @@ -804,7 +870,7 @@ case $system in ;; Linux*) SHLIB_CFLAGS="-fPIC" - SHLIB_LD_LIBS='${LIBS}' + SHLIB_LD_LIBS="${LIBS}" SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" @@ -966,7 +1032,8 @@ case $system in TCL_UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; - SunOS-5*) + SunOS-5.[[0-6]]*) +# SunOS-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="/usr/ccs/bin/ld -G -z text" @@ -980,6 +1047,40 @@ case $system in LD_FLAGS="" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' ;; + SunOS-5*) + SHLIB_CFLAGS="-KPIC" + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + LD_FLAGS="" + + do64bit_ok=no + if test "$do64bit" = "yes" ; then + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then + do64bit_ok=yes + EXTRA_CFLAGS="-xarch=v9" + LD_FLAGS="-xarch=v9" + else + AC_MSG_WARN("64bit mode not supported using GCC on $system") + fi + else + AC_MSG_WARN("64bit mode only supported sparcv9 system") + fi + fi + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" + if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + fi + ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" @@ -1014,6 +1115,10 @@ case $system in ;; esac +if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then + AC_MSG_WARN("64bit support being disabled -- not supported on this platform") +fi + # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need @@ -1140,15 +1245,15 @@ if test "$DL_OBJS" != "tclLoadNone.o" ; then fi fi -# Set the default compiler switches based on the --enable-symbols option +# Set the default compiler switches based on the --enable-symbols option AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes"; then - CFLAGS_DEFAULT=CFLAGS_DEBUG + CFLAGS='$(CFLAGS_DEBUG)' TCL_DBGX=g else - CFLAGS_DEFAULT=CFLAGS_OPTIMIZE + CFLAGS='$(CFLAGS_OPTIMIZE)' TCL_DBGX="" fi @@ -1216,8 +1321,8 @@ if test "$TCL_UNSHARED_LIB_SUFFIX" = "" ; then TCL_UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' fi AC_ARG_ENABLE(shared, - [ --enable-shared build libtcl as a shared library], - [tcl_ok=$enableval], [tcl_ok=no]) + [ --enable-shared build libtcl as a shared library (on by default)], + [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "yes" -a "${SHLIB_SUFFIX}" != "" ; then TCL_SHARED_BUILD=1 TCL_SHLIB_CFLAGS="${SHLIB_CFLAGS}" @@ -1278,7 +1383,6 @@ else TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}" TCL_LIB_SPEC="-bI:${exec_prefix}/lib/${TCL_EXP_FILE}" fi - VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" @@ -1333,8 +1437,8 @@ AC_SUBST(TCL_STUB_LIB_PATH) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(BUILD_DLTEST) +AC_SUBST(CFLAGS) AC_SUBST(CFLAGS_DEBUG) -AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX) |