diff options
author | das <das> | 2006-01-10 05:38:19 (GMT) |
---|---|---|
committer | das <das> | 2006-01-10 05:38:19 (GMT) |
commit | bad210c83a783476d088f18141f858e71894fea3 (patch) | |
tree | 87862859fde56ea445ee805d344b86ae4489b329 /unix/tcl.m4 | |
parent | c97f485feb8a8de6050fa13f72a5a808cc6f05d0 (diff) | |
download | tk-bad210c83a783476d088f18141f858e71894fea3.zip tk-bad210c83a783476d088f18141f858e71894fea3.tar.gz tk-bad210c83a783476d088f18141f858e71894fea3.tar.bz2 |
* macosx/tkMacOSXDraw.c: re-added inclusion of tclInt.h to allow access
* macosx/tkMacOSXFont.c: to 8.4-internal Tcl_CreateNamespace().
* macosx/tkMacOSXDebug.c: add TkMacOSXGetNamedDebugSymbol() function
* macosx/tkMacOSXDebug.h: that finds unexported symbols in loaded
libraries by manually walking their symbol table; only to be used for
debugging purposes, may break unexpectedly in the future. Needed to get
access to private_extern internal debugging functions in HIToolbox.
* macosx/tkMacOSXCarbonEvents.c: fix debug event tracing on Tiger.
* macosx/tkMacOSXMenu.c: add debug menu printing during reconfigure.
* macosx/tkMacOSXInit.c: conditionalize 64bit-unsafe dyld code.
* macosx/Makefile: add 'wish8.x' symlink to SYMROOT.
* unix/configure: add caching, use AC_CACHE_CHECK instead of
* unix/configure.in: AC_CACHE_VAL where possible, consistent message
* unix/tcl.m4: quoting, sync relevant tclconfig/tcl.m4 changes and
gratuitous formatting differences, fix SC_CONFIG_MANPAGES with default
argument, Darwin improvements to SC_LOAD_*CONFIG.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r-- | unix/tcl.m4 | 476 |
1 files changed, 287 insertions, 189 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 1c11781..9b86a7b 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -62,9 +62,25 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [ done fi + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tcl.framework/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + break + fi + done + fi + # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ @@ -93,12 +109,12 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [ if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" - AC_MSG_WARN(Can't find Tcl configuration definitions) + AC_MSG_WARN([Can't find Tcl configuration definitions]) exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} - AC_MSG_RESULT(found $TCL_BIN_DIR/tclConfig.sh) + AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) @@ -165,9 +181,26 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ fi done fi + + # on Darwin, check in Framework installation locations + if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then + for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ + `ls -d /Library/Frameworks 2>/dev/null` \ + `ls -d /Network/Library/Frameworks 2>/dev/null` \ + `ls -d /System/Library/Frameworks 2>/dev/null` \ + ; do + if test -f "$i/Tk.framework/tkConfig.sh" ; then + ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + break + fi + done + fi + # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d ${exec_prefix}/lib 2>/dev/null` \ + `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ @@ -192,17 +225,17 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ done fi ]) + if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" - AC_MSG_WARN(Can't find Tk configuration definitions) + AC_MSG_WARN([Can't find Tk configuration definitions]) exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} - AC_MSG_RESULT(found $TK_BIN_DIR/tkConfig.sh) + AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi - ]) #------------------------------------------------------------------------ @@ -225,39 +258,55 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ #------------------------------------------------------------------------ AC_DEFUN(SC_LOAD_TCLCONFIG, [ - AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) + AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) - . $TCL_BIN_DIR/tclConfig.sh + . ${TCL_BIN_DIR}/tclConfig.sh else - AC_MSG_RESULT([file not found]) + AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi - # + # eval is required to do the TCL_DBGX substitution + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then + if test -f ${TCL_BIN_DIR}/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tcl was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tcl.framework installed in an arbitary location. + case ${TCL_DEFS} in + *TCL_FRAMEWORK*) + if test -f ${TCL_BIN_DIR}/${TCL_LIB_FILE}; then + for i in "`cd ${TCL_BIN_DIR}; pwd`" \ + "`cd ${TCL_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then + TCL_LIB_SPEC="-F`dirname "$i"` -framework ${TCL_LIB_FILE}" + break + fi + done + fi + if test -f ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}; then + TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" + fi + ;; + esac fi - # # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" @@ -291,19 +340,69 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [ #------------------------------------------------------------------------ AC_DEFUN(SC_LOAD_TKCONFIG, [ - AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh]) + AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) - if test -f "$TK_BIN_DIR/tkConfig.sh" ; then + if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) - . $TK_BIN_DIR/tkConfig.sh + . ${TK_BIN_DIR}/tkConfig.sh else - AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh]) + AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" + eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" + + # If the TK_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TK_LIB_SPEC will be set to the value + # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC + # instead of TK_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + if test -f ${TK_BIN_DIR}/Makefile ; then + TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} + TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} + TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} + elif test "`uname -s`" = "Darwin"; then + # If Tk was built as a framework, attempt to use the libraries + # from the framework at the given location so that linking works + # against Tk.framework installed in an arbitary location. + case ${TK_DEFS} in + *TK_FRAMEWORK*) + if test -f ${TK_BIN_DIR}/${TK_LIB_FILE}; then + for i in "`cd ${TK_BIN_DIR}; pwd`" \ + "`cd ${TK_BIN_DIR}/../..; pwd`"; do + if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then + TK_LIB_SPEC="-F`dirname "$i"` -framework ${TK_LIB_FILE}" + break + fi + done + fi + if test -f ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}; then + TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" + fi + ;; + esac + fi + + # eval is required to do the TK_DBGX substitution + eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" + eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" + eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) + AC_SUBST(TK_LIB_FILE) + AC_SUBST(TK_LIB_FLAG) + AC_SUBST(TK_LIB_SPEC) + + AC_SUBST(TK_STUB_LIB_FILE) + AC_SUBST(TK_STUB_LIB_FLAG) + AC_SUBST(TK_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ @@ -328,7 +427,6 @@ AC_DEFUN(SC_LOAD_TKCONFIG, [ AC_DEFUN(SC_PROG_TCLSH, [ AC_MSG_CHECKING([for tclsh]) - AC_CACHE_VAL(ac_cv_path_tclsh, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do @@ -346,7 +444,7 @@ AC_DEFUN(SC_PROG_TCLSH, [ if test -f "$ac_cv_path_tclsh" ; then TCLSH_PROG="$ac_cv_path_tclsh" - AC_MSG_RESULT($TCLSH_PROG) + AC_MSG_RESULT([$TCLSH_PROG]) else # It is not an error if an installed version of Tcl can't be located. TCLSH_PROG="" @@ -375,7 +473,7 @@ AC_DEFUN(SC_PROG_TCLSH, [ AC_DEFUN(SC_BUILD_TCLSH, [ AC_MSG_CHECKING([for tclsh in Tcl build directory]) BUILD_TCLSH=${TCL_BIN_DIR}/tclsh - AC_MSG_RESULT($BUILD_TCLSH) + AC_MSG_RESULT([$BUILD_TCLSH]) AC_SUBST(BUILD_TCLSH) ]) @@ -457,11 +555,11 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [ AC_MSG_RESULT([framework]) FRAMEWORK_BUILD=1 if test "${SHARED_BUILD}" = "0" ; then - AC_MSG_WARN("Frameworks can only be built if --enable-shared is yes") + AC_MSG_WARN([Frameworks can only be built if --enable-shared is yes]) FRAMEWORK_BUILD=0 fi if test $tcl_corefoundation = no; then - AC_MSG_WARN("Frameworks can only be used when CoreFoundation is available") + AC_MSG_WARN([Frameworks can only be used when CoreFoundation is available]) FRAMEWORK_BUILD=0 fi else @@ -496,18 +594,15 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [ #------------------------------------------------------------------------ AC_DEFUN(SC_ENABLE_THREADS, [ - AC_MSG_CHECKING(for building with threads) AC_ARG_ENABLE(threads, [ --enable-threads build with threads], [tcl_ok=$enableval], [tcl_ok=no]) + if test "${TCL_THREADS}" = 1; then + tcl_threaded_core=1; + fi + if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then - if test "${TCL_THREADS}" = 1; then - AC_MSG_RESULT([yes (threaded core)]) - else - AC_MSG_RESULT([yes]) - fi TCL_THREADS=1 - AC_DEFINE(TCL_THREADS) # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention AC_DEFINE(USE_THREAD_ALLOC) @@ -523,29 +618,33 @@ AC_DEFUN(SC_ENABLE_THREADS, [ # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] - AC_CHECK_LIB(pthread,__pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + AC_CHECK_LIB(pthread, __pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else - AC_CHECK_LIB(pthreads,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + AC_CHECK_LIB(pthreads, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else - AC_CHECK_LIB(c,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) - if test "$tcl_ok" = "no"; then - AC_CHECK_LIB(c_r,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + AC_CHECK_LIB(c, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) + if test "$tcl_ok" = "no"; then + AC_CHECK_LIB(c_r, pthread_mutex_init, + tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 - 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...") + 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 - fi + fi fi fi @@ -559,8 +658,20 @@ AC_DEFUN(SC_ENABLE_THREADS, [ LIBS=$ac_saved_libs else TCL_THREADS=0 + fi + # Do checking message here to not mess up interleaved configure output + AC_MSG_CHECKING([for building with threads]) + if test "${TCL_THREADS}" = 1; then + AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) + if test "${tcl_threaded_core}" = 1; then + AC_MSG_RESULT([yes (threaded core)]) + else + AC_MSG_RESULT([yes]) + fi + else AC_MSG_RESULT([no (default)]) fi + AC_SUBST(TCL_THREADS) ]) @@ -666,7 +777,7 @@ AC_DEFUN(SC_ENABLE_LANGINFO, [ AC_CACHE_VAL(tcl_cv_langinfo_h, AC_TRY_COMPILE([#include <langinfo.h>], [nl_langinfo(CODESET);], [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])) - AC_MSG_RESULT($tcl_cv_langinfo_h) + AC_MSG_RESULT([$tcl_cv_langinfo_h]) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO) fi @@ -714,8 +825,11 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [ AC_ARG_ENABLE(man-compression, [ --enable-man-compression=PROG compress the manpages with PROG], - test "$enableval" = "yes" && AC_MSG_ERROR([missing argument to --enable-man-compression]) - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval", + [case $enableval in + yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);; + no) ;; + *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; + esac], enableval="no") AC_MSG_RESULT([$enableval]) if test "$enableval" != "no"; then @@ -733,8 +847,11 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [ [ --enable-man-suffix=STRING use STRING as a suffix to manpage file names (default: $1)], - test "$enableval" = "yes" && enableval="$1" - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval", + [case $enableval in + yes) enableval="$1" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; + no) ;; + *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; + esac], enableval="no") AC_MSG_RESULT([$enableval]) @@ -742,6 +859,49 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [ ]) #-------------------------------------------------------------------- +# SC_CONFIG_SYSTEM +# +# Determine what the system is (some things cannot be easily checked +# on a feature-driven basis, alas). This can usually be done via the +# "uname" command, but there are a few systems, like Next, where +# this doesn't work. +# +# Arguments: +# none +# +# Results: +# Defines the following var: +# +# system - System/platform/version identification code. +# +#-------------------------------------------------------------------- + +AC_DEFUN(SC_CONFIG_SYSTEM, [ + AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ + if test -f /usr/lib/NextStep/software_version; then + tcl_cv_sys_version=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` + else + tcl_cv_sys_version=`uname -s`-`uname -r` + if test "$?" -ne 0 ; then + AC_MSG_WARN([can't find uname command]) + tcl_cv_sys_version=unknown + else + # Special check for weird MP-RAS system (uname returns weird + # results, and the version is kept in special file). + + if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then + tcl_cv_sys_version=MP-RAS-`awk '{print $3}' /etc/.relid` + fi + if test "`uname -s`" = "AIX" ; then + tcl_cv_sys_version=AIX-`uname -v`.`uname -r` + fi + fi + fi + ]) + system=$tcl_cv_sys_version +]) + +#-------------------------------------------------------------------- # SC_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler @@ -839,54 +999,26 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no") - - if test "$enableval" = "yes"; then - do64bit=yes - else - do64bit=no - fi - AC_MSG_RESULT($do64bit) + AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], + [do64bit=$enableval], [do64bit=no]) + AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no") + AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support], + [do64bitVIS=$enableval], [do64bitVIS=no]) + AC_MSG_RESULT([$do64bitVIS]) - if test "$enableval" = "yes"; then + if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes - do64bitVIS=yes - else - do64bitVIS=no fi - AC_MSG_RESULT($do64bitVIS) # Step 1: set the variable "system" to hold the name and version number - # for the system. This can usually be done via the "uname" command, but - # there are a few systems, like Next, where this doesn't work. + # for the system. - AC_MSG_CHECKING([system version (for dynamic loading)]) - if test -f /usr/lib/NextStep/software_version; then - system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - system=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - AC_MSG_RESULT([unknown (can't find uname command)]) - system=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - system=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - system=AIX-`uname -v`.`uname -r` - fi - AC_MSG_RESULT($system) - fi - fi + SC_CONFIG_SYSTEM # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. @@ -1090,18 +1222,18 @@ dnl AC_CHECK_TOOL(AR, ar) # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then - hpux_arch=`gcc -dumpmachine` + hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes - SHLIB_LD="gcc -shared" + SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS='${LIBS}' CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) - AC_MSG_WARN("64bit mode not supported with GCC on $system") + AC_MSG_WARN([64bit mode not supported with GCC on $system]) ;; esac else @@ -1310,17 +1442,17 @@ dnl AC_CHECK_TOOL(AR, ar) DL_LIBS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - AC_MSG_CHECKING(for ELF) - AC_EGREP_CPP(yes, [ + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif - ], - AC_MSG_RESULT(yes) - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so', - AC_MSG_RESULT(no) + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so' + else SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - ) + fi ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" @@ -1368,17 +1500,17 @@ dnl AC_CHECK_TOOL(AR, ar) CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' - AC_MSG_CHECKING(for ELF) - AC_EGREP_CPP(yes, [ + AC_CACHE_CHECK([for ELF], tcl_cv_ld_elf, [ + AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif - ], - AC_MSG_RESULT(yes) - [ LDFLAGS=-Wl,-export-dynamic ], - AC_MSG_RESULT(no) + ], tcl_cv_ld_elf=yes, tcl_cv_ld_elf=no)]) + if test $tcl_cv_ld_elf = yes; then + LDFLAGS=-Wl,-export-dynamic + else LDFLAGS="" - ) + fi ;; esac @@ -1501,8 +1633,8 @@ dnl AC_CHECK_TOOL(AR, ar) LD_SEARCH_FLAGS="" ;; OS/390-*) - CFLAGS_OPTIMIZE="" # Optimizer is buggy - AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h + CFLAGS_OPTIMIZE="" # Optimizer is buggy + AC_DEFINE(_OE_SOCKETS) # needed in sys/socket.h ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 @@ -1760,12 +1892,14 @@ dnl AC_CHECK_TOOL(AR, ar) DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. - hold_ldflags=$LDFLAGS - AC_MSG_CHECKING(for ld accepts -Bexport flag) - LDFLAGS="$LDFLAGS -Wl,-Bexport" - AC_TRY_LINK(, [int i;], [found=yes], - [LDFLAGS=$hold_ldflags found=no]) - AC_MSG_RESULT($found) + AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ + hold_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-Bexport" + AC_TRY_LINK(, [int i;], tcl_cv_ld_Bexport=yes, tcl_cv_ld_Bexport=no) + LDFLAGS=$hold_ldflags]) + if test $tcl_cv_ld_Bexport = yes; then + LDFLAGS="$LDFLAGS -Wl,-Bexport" + fi CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; @@ -1795,7 +1929,7 @@ dnl AC_CHECK_TOOL(AR, ar) # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then - AC_MSG_CHECKING(sys/exec.h) + AC_CACHE_CHECK([sys/exec.h], tcl_cv_sysexec_h, [ AC_TRY_COMPILE([#include <sys/exec.h>],[ struct exec foo; unsigned long seek; @@ -1807,12 +1941,11 @@ dnl AC_CHECK_TOOL(AR, ar) #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; - ], tcl_ok=usable, tcl_ok=unusable) - AC_MSG_RESULT($tcl_ok) - if test $tcl_ok = usable; then + ], tcl_cv_sysexec_h=usable, tcl_cv_sysexec_h=unusable)]) + if test $tcl_cv_sysexec_h = usable; then AC_DEFINE(USE_SYS_EXEC_H) else - AC_MSG_CHECKING(a.out.h) + AC_CACHE_CHECK([a.out.h], tcl_cv_aout_h, [ AC_TRY_COMPILE([#include <a.out.h>],[ struct exec foo; unsigned long seek; @@ -1824,12 +1957,11 @@ dnl AC_CHECK_TOOL(AR, ar) #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; - ], tcl_ok=usable, tcl_ok=unusable) - AC_MSG_RESULT($tcl_ok) - if test $tcl_ok = usable; then + ], tcl_cv_aout_h=usable, tcl_cv_aout_h=unusable)]) + if test $tcl_cv_aout_h = usable; then AC_DEFINE(USE_A_OUT_H) else - AC_MSG_CHECKING(sys/exec_aout.h) + AC_CACHE_CHECK([sys/exec_aout.h], tcl_cv_sysexecaout_h, [ AC_TRY_COMPILE([#include <sys/exec_aout.h>],[ struct exec foo; unsigned long seek; @@ -1841,9 +1973,8 @@ dnl AC_CHECK_TOOL(AR, ar) #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; - ], tcl_ok=usable, tcl_ok=unusable) - AC_MSG_RESULT($tcl_ok) - if test $tcl_ok = usable; then + ], tcl_cv_sysexecaout_h=usable, tcl_cv_sysexecaout_h=unusable)]) + if test $tcl_cv_sysexecaout_h = usable; then AC_DEFINE(USE_SYS_EXEC_AOUT_H) else DL_OBJS="" @@ -2009,8 +2140,7 @@ dnl esac AC_DEFUN(SC_SERIAL_PORT, [ AC_CHECK_HEADERS(sys/modem.h) - AC_MSG_CHECKING([termios vs. termio vs. sgtty]) - AC_CACHE_VAL(tcl_cv_api_serial, [ + AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ AC_TRY_RUN([ #include <termios.h> @@ -2102,7 +2232,6 @@ int main() { termio) AC_DEFINE(USE_TERMIO);; sgtty) AC_DEFINE(USE_SGTTY);; esac - AC_MSG_RESULT($tcl_cv_api_serial) ]) #-------------------------------------------------------------------- @@ -2137,8 +2266,7 @@ int main() { #-------------------------------------------------------------------- AC_DEFUN(SC_MISSING_POSIX_HEADERS, [ - AC_MSG_CHECKING(dirent.h) - AC_CACHE_VAL(tcl_cv_dirent_h, + AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, AC_TRY_LINK([#include <sys/types.h> #include <dirent.h>], [ #ifndef _POSIX_SOURCE @@ -2164,7 +2292,6 @@ closedir(d); AC_DEFINE(NO_DIRENT_H) 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)]) @@ -2229,14 +2356,14 @@ AC_DEFUN(SC_PATH_X, [ fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then - AC_MSG_CHECKING(for X11 header files) + AC_MSG_CHECKING([for X11 header files]) found_xincludes="no" AC_TRY_CPP([#include <X11/Intrinsic.h>], found_xincludes="yes", found_xincludes="no") if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then - AC_MSG_RESULT($i) + AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" found_xincludes="yes" break @@ -2250,16 +2377,16 @@ AC_DEFUN(SC_PATH_X, [ fi fi if test found_xincludes = "no"; then - AC_MSG_RESULT(couldn't find any!) + AC_MSG_RESULT([couldn't find any!]) fi if test "$no_x" = yes; then - AC_MSG_CHECKING(for X11 libraries) + AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then - AC_MSG_RESULT($i) + AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break @@ -2276,7 +2403,7 @@ AC_DEFUN(SC_PATH_X, [ AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then - AC_MSG_RESULT(couldn't find any! Using -lX11.) + AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi ]) @@ -2305,25 +2432,8 @@ AC_DEFUN(SC_PATH_X, [ AC_DEFUN(SC_BLOCKING_STYLE, [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) + SC_CONFIG_SYSTEM AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) - if test -f /usr/lib/NextStep/software_version; then - system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` - else - system=`uname -s`-`uname -r` - if test "$?" -ne 0 ; then - system=unknown - else - # Special check for weird MP-RAS system (uname returns weird - # results, and the version is kept in special file). - - if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then - system=MP-RAS-`awk '{print $3}' /etc/.relid` - fi - if test "`uname -s`" = "AIX" ; then - system=AIX-`uname -v`.`uname -r` - fi - fi - fi case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since @@ -2332,18 +2442,18 @@ AC_DEFUN(SC_BLOCKING_STYLE, [ OSF*) AC_DEFINE(USE_FIONBIO) - AC_MSG_RESULT(FIONBIO) + AC_MSG_RESULT([FIONBIO]) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO) - AC_MSG_RESULT(FIONBIO) + AC_MSG_RESULT([FIONBIO]) ;; ULTRIX-4.*) AC_DEFINE(USE_FIONBIO) - AC_MSG_RESULT(FIONBIO) + AC_MSG_RESULT([FIONBIO]) ;; *) - AC_MSG_RESULT(O_NONBLOCK) + AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) @@ -2374,20 +2484,16 @@ AC_DEFUN(SC_TIME_HANDLER, [ AC_CHECK_FUNCS(gmtime_r localtime_r) - AC_MSG_CHECKING([tm_tzadj in struct tm]) - AC_CACHE_VAL(tcl_cv_member_tm_tzadj, + AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)) - AC_MSG_RESULT($tcl_cv_member_tm_tzadj) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ) fi - AC_MSG_CHECKING([tm_gmtoff in struct tm]) - AC_CACHE_VAL(tcl_cv_member_tm_gmtoff, + AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)) - AC_MSG_RESULT($tcl_cv_member_tm_gmtoff) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF) fi @@ -2396,28 +2502,24 @@ AC_DEFUN(SC_TIME_HANDLER, [ # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # - AC_MSG_CHECKING([long timezone variable]) - AC_CACHE_VAL(tcl_cv_timezone_long, + AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, AC_TRY_COMPILE([#include <time.h>], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)) - AC_MSG_RESULT($tcl_cv_timezone_long) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # - AC_MSG_CHECKING([time_t timezone variable]) - AC_CACHE_VAL(tcl_cv_timezone_time, + AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, AC_TRY_COMPILE([#include <time.h>], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)) - AC_MSG_RESULT($tcl_cv_timezone_time) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR) fi @@ -2447,8 +2549,7 @@ AC_DEFUN(SC_TIME_HANDLER, [ AC_DEFUN(SC_BUGGY_STRTOD, [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then - AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs]) - AC_CACHE_VAL(tcl_cv_strtod_buggy,[ + AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ AC_TRY_RUN([ extern double strtod(); int main() { @@ -2468,11 +2569,9 @@ AC_DEFUN(SC_BUGGY_STRTOD, [ exit(1); } exit(0); - }], tcl_cv_strtod_buggy=1, tcl_cv_strtod_buggy=0, tcl_cv_strtod_buggy=0)]) - if test "$tcl_cv_strtod_buggy" = 1; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT(buggy) + }], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy, + tcl_cv_strtod_buggy=buggy)]) + if test "$tcl_cv_strtod_buggy" = buggy; then LIBOBJS="$LIBOBJS fixstrtod.o" AC_DEFINE(strtod, fixstrtod) fi @@ -2593,7 +2692,8 @@ AC_DEFUN(SC_TCL_EARLY_FLAG,[ if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1) tcl_flags="$tcl_flags $1" - fi]) + fi +]) AC_DEFUN(SC_TCL_EARLY_FLAGS,[ AC_MSG_CHECKING([for required early compiler flags]) @@ -2605,10 +2705,11 @@ AC_DEFUN(SC_TCL_EARLY_FLAGS,[ SC_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>], [char *p = (char *)open64;]) if test "x${tcl_flags}" = "x" ; then - AC_MSG_RESULT(none) + AC_MSG_RESULT([none]) else - AC_MSG_RESULT(${tcl_flags}) - fi]) + AC_MSG_RESULT([${tcl_flags}]) + fi +]) #-------------------------------------------------------------------- # SC_TCL_64BIT_FLAGS @@ -2644,31 +2745,27 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [ }],tcl_cv_type_64bit=${tcl_type_64bit})]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG) - AC_MSG_RESULT(using long) + AC_MSG_RESULT([using long]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}) - AC_MSG_RESULT(${tcl_cv_type_64bit}) + AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations - AC_MSG_CHECKING([for struct dirent64]) - AC_CACHE_VAL(tcl_cv_struct_dirent64,[ + AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include <sys/types.h> #include <sys/dirent.h>],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64) fi - AC_MSG_RESULT(${tcl_cv_struct_dirent64}) - AC_MSG_CHECKING([for struct stat64]) - AC_CACHE_VAL(tcl_cv_struct_stat64,[ + AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64) fi - AC_MSG_RESULT(${tcl_cv_struct_stat64}) AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) @@ -2682,8 +2779,9 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T) - AC_MSG_RESULT(yes) + AC_MSG_RESULT([yes]) else - AC_MSG_RESULT(no) + AC_MSG_RESULT([no]) fi - fi]) + fi +]) |