summaryrefslogtreecommitdiffstats
path: root/unix/tcl.m4
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r--unix/tcl.m4422
1 files changed, 253 insertions, 169 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 879ea13..3d35a27 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -72,9 +72,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` \
@@ -103,12 +119,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
])
@@ -185,9 +201,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` \
@@ -212,17 +245,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
-
])
#------------------------------------------------------------------------
@@ -245,40 +278,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
- # (@@@ Is this still the case?)
- #
-
- 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}\""
@@ -312,19 +360,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)
])
#------------------------------------------------------------------------
@@ -349,7 +447,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
@@ -367,7 +464,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=""
@@ -396,7 +493,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)
])
@@ -480,11 +577,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
@@ -517,20 +614,17 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [
#------------------------------------------------------------------------
AC_DEFUN(SC_ENABLE_THREADS, [
- AC_MSG_CHECKING(for building with threads)
AC_ARG_ENABLE(threads,
AC_HELP_STRING([--enable-threads],
[build with threads (default: off)]),
[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, 1, [Are we building with threads enabled?])
# USE_THREAD_ALLOC tells us to try the special thread-based
# allocator that significantly reduces lock contention
AC_DEFINE(USE_THREAD_ALLOC, 1,
@@ -548,29 +642,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
@@ -584,12 +682,11 @@ AC_DEFUN(SC_ENABLE_THREADS, [
if test $tcl_ok = yes ; then
AC_DEFINE(HAVE_PTHREAD_ATTR_GET_NP, 1,
[Do we want a BSD-like thread-attribute interface?])
- AC_MSG_CHECKING([for pthread_attr_get_np declaration])
- AC_CACHE_VAL(tcl_cv_grep_pthread_attr_get_np,
+ AC_CACHE_CHECK([for pthread_attr_get_np declaration],
+ tcl_cv_grep_pthread_attr_get_np,
AC_EGREP_HEADER(pthread_attr_get_np, pthread.h,
tcl_cv_grep_pthread_attr_get_np=present,
tcl_cv_grep_pthread_attr_get_np=missing))
- AC_MSG_RESULT($tcl_cv_grep_pthread_attr_get_np)
if test $tcl_cv_grep_pthread_attr_get_np = missing ; then
AC_DEFINE(ATTRGETNP_NOT_DECLARED, 1,
[Is pthread_attr_get_np() declared in <pthread.h>?])
@@ -599,12 +696,11 @@ AC_DEFUN(SC_ENABLE_THREADS, [
if test $tcl_ok = yes ; then
AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, 1,
[Do we want a Linux-like thread-attribute interface?])
- AC_MSG_CHECKING([for pthread_getattr_np declaration])
- AC_CACHE_VAL(tcl_cv_grep_pthread_getattr_np,
+ AC_CACHE_CHECK([for pthread_getattr_np declaration],
+ tcl_cv_grep_pthread_getattr_np,
AC_EGREP_HEADER(pthread_getattr_np, pthread.h,
tcl_cv_grep_pthread_getattr_np=present,
tcl_cv_grep_pthread_getattr_np=missing))
- AC_MSG_RESULT($tcl_cv_grep_pthread_getattr_np)
if test $tcl_cv_grep_pthread_getattr_np = missing ; then
AC_DEFINE(GETATTRNP_NOT_DECLARED, 1,
[Is pthread_getattr_np declared in <pthread.h>?])
@@ -614,8 +710,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)
])
@@ -728,7 +836,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, 1, [Do we have nl_langinfo()?])
fi
@@ -742,8 +850,8 @@ AC_DEFUN(SC_ENABLE_LANGINFO, [
#
# Decide whether to use symlinks for linking the manpages,
# whether to compress the manpages after installation, and
-# whether to add a package name suffix to the installed
-# manpages to avoidfile name clashes.
+# whether to add a package name suffix to the installed
+# manpages to avoidfile name clashes.
# If compression is enabled also find out what file name suffix
# the given compression program is using.
#
@@ -799,7 +907,7 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [
AC_HELP_STRING([--enable-man-suffix=STRING],
[use STRING as a suffix to manpage file names (default: no, AC_PACKAGE_NAME if enabled without specifying STRING)]),
[case $enableval in
- yes) enableval="AC_PACKAGE_NAME";;
+ yes) enableval="AC_PACKAGE_NAME" MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
no) ;;
*) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";;
esac],
@@ -810,7 +918,7 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [
])
#--------------------------------------------------------------------
-# TCL_CONFIG_SYSTEM
+# 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
@@ -827,9 +935,8 @@ AC_DEFUN(SC_CONFIG_MANPAGES, [
#
#--------------------------------------------------------------------
-AC_DEFUN(TCL_CONFIG_SYSTEM, [
- AC_MSG_CHECKING([system version])
- AC_CACHE_VAL(tcl_cv_sys_version,[
+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
@@ -848,8 +955,8 @@ AC_DEFUN(TCL_CONFIG_SYSTEM, [
tcl_cv_sys_version=AIX-`uname -v`.`uname -r`
fi
fi
- fi])
- AC_MSG_RESULT($tcl_cv_sys_version)
+ fi
+ ])
system=$tcl_cv_sys_version
])
@@ -945,7 +1052,7 @@ AC_DEFUN(TCL_CONFIG_SYSTEM, [
# Flags used when running the compiler in debug mode
# CFLAGS_OPTIMIZE -
# Flags used when running the compiler in optimize mode
-# CFLAGS
+# CFLAGS - Additional CFLAGS added as necessary (usually 64-bit)
#
#--------------------------------------------------------------------
@@ -957,14 +1064,8 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
AC_ARG_ENABLE(64bit,
AC_HELP_STRING([--enable-64bit],
[enable 64bit support (default: off)]),
- ,enableval="no")
-
- if test "$enableval" = "yes"; then
- do64bit=yes
- else
- do64bit=no
- fi
- AC_MSG_RESULT($do64bit)
+ [do64bit=$enableval], [do64bit=no])
+ AC_MSG_RESULT([$do64bit])
# Step 0.b: Enable Solaris 64 bit VIS support?
@@ -972,21 +1073,18 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
AC_ARG_ENABLE(64bit-vis,
AC_HELP_STRING([--enable-64bit-vis],
[enable 64bit Sparc VIS support (default: off)]),
- ,enableval="no")
+ [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.
- TCL_CONFIG_SYSTEM
+ 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.
@@ -1034,9 +1132,14 @@ dnl AC_CHECK_TOOL(AR, ar)
AIX-*)
if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then
# AIX requires the _r compiler when gcc isn't being used
- if test "${CC}" != "cc_r" ; then
- CC=${CC}_r
- fi
+ case "${CC}" in
+ *_r)
+ # ok ...
+ ;;
+ *)
+ CC=${CC}_r
+ ;;
+ esac
AC_MSG_RESULT([Using $CC for compiling with threads])
fi
LIBS="$LIBS -lc"
@@ -1189,18 +1292,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
@@ -1336,16 +1439,16 @@ dnl AC_CHECK_TOOL(AR, ar)
;;
Lynx*)
SHLIB_CFLAGS="-fPIC"
- SHLIB_LD_LIBS='${LIBS}'
+ SHLIB_LD_LIBS='${LIBS}'
SHLIB_SUFFIX=".so"
- CFLAGS_OPTIMIZE=-02
+ CFLAGS_OPTIMIZE=-02
SHLIB_LD="${CC} -shared "
DL_OBJS="tclLoadDl.o"
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
- ;;
+ LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
+ ;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
SHLIB_LD="cc -G"
@@ -1377,17 +1480,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}.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}.so'
+ else
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'
- )
+ fi
# Ancient FreeBSD doesn't handle version numbers with dots.
@@ -1410,17 +1513,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}.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
# OpenBSD doesn't do version numbers with dots.
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
@@ -1733,6 +1836,8 @@ dnl AC_CHECK_TOOL(AR, ar)
CFLAGS="$CFLAGS -xarch=v9"
LDFLAGS_ARCH="-xarch=v9"
fi
+ # Solaris 64 uses this as well
+ #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64"
fi
elif test "$arch" = "amd64 i386" ; then
if test "$GCC" = "yes" ; then
@@ -1782,12 +1887,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=""
;;
@@ -1845,12 +1952,8 @@ dnl AC_CHECK_TOOL(AR, ar)
;;
Darwin-*)
;;
- RISCos-*)
- ;;
SCO_SV-3.2*)
;;
- ULTRIX-4.*)
- ;;
*)
SHLIB_CFLAGS="-fPIC"
;;
@@ -1974,8 +2077,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>
@@ -2067,7 +2169,6 @@ int main() {
termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);;
sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);;
esac
- AC_MSG_RESULT($tcl_cv_api_serial)
])
#--------------------------------------------------------------------
@@ -2100,8 +2201,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
@@ -2127,7 +2227,6 @@ closedir(d);
AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
fi
- AC_MSG_RESULT($tcl_ok)
AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have <float.h>?])])
AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have <values.h>?])])
AC_CHECK_HEADER(limits.h,
@@ -2192,14 +2291,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
@@ -2213,16 +2312,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
@@ -2239,7 +2338,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
])
@@ -2268,7 +2367,7 @@ AC_DEFUN(SC_PATH_X, [
AC_DEFUN(SC_BLOCKING_STYLE, [
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS(sys/filio.h)
- TCL_CONFIG_SYSTEM
+ SC_CONFIG_SYSTEM
AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O])
case $system in
# There used to be code here to use FIONBIO under AIX. However, it
@@ -2278,18 +2377,14 @@ AC_DEFUN(SC_BLOCKING_STYLE, [
OSF*)
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
- AC_MSG_RESULT(FIONBIO)
+ AC_MSG_RESULT([FIONBIO])
;;
SunOS-4*)
AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
- AC_MSG_RESULT(FIONBIO)
- ;;
- ULTRIX-4.*)
- AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?])
- AC_MSG_RESULT(FIONBIO)
+ AC_MSG_RESULT([FIONBIO])
;;
*)
- AC_MSG_RESULT(O_NONBLOCK)
+ AC_MSG_RESULT([O_NONBLOCK])
;;
esac
])
@@ -2320,20 +2415,16 @@ AC_DEFUN(SC_TIME_HANDLER, [
AC_CHECK_FUNCS(gmtime_r localtime_r mktime)
- 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, 1, [Should we use the tm_tzadj field of struct tm?])
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, 1, [Should we use the tm_gmtoff field of struct tm?])
fi
@@ -2342,28 +2433,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, 1, [Should we use the global timezone variable?])
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, 1, [Should we use the global timezone variable?])
fi
@@ -2393,8 +2480,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() {
@@ -2414,11 +2500,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
AC_LIBOBJ([fixstrtod])
USE_COMPAT=1
AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
@@ -2514,6 +2598,7 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [
# Might define the following vars:
# _ISOC99_SOURCE
# _LARGEFILE64_SOURCE
+# _LARGEFILE_SOURCE64
#
#--------------------------------------------------------------------
@@ -2527,7 +2612,8 @@ AC_DEFUN(SC_TCL_EARLY_FLAG,[
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
tcl_flags="$tcl_flags $1"
- fi])
+ fi
+])
AC_DEFUN(SC_TCL_EARLY_FLAGS,[
AC_MSG_CHECKING([for required early compiler flags])
@@ -2539,10 +2625,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
@@ -2578,32 +2665,28 @@ 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, 1, [Are wide integers to be implemented with C 'long's?])
- AC_MSG_RESULT(using long)
+ AC_MSG_RESULT([using long])
else
AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit},
[What type should be used to define wide integers?])
- 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, 1, [Is 'struct dirent64' in <sys/types.h>?])
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, 1, [Is 'struct stat64' in <sys/stat.h>?])
fi
- AC_MSG_RESULT(${tcl_cv_struct_stat64})
AC_CHECK_FUNCS(open64 lseek64)
AC_MSG_CHECKING([for off64_t])
@@ -2617,11 +2700,12 @@ 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, 1, [Is off64_t in <sys/types.h>?])
- AC_MSG_RESULT(yes)
+ AC_MSG_RESULT([yes])
else
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT([no])
fi
- fi])
+ fi
+])
#--------------------------------------------------------------------
# SC_TCL_CFG_ENCODING TIP #59
@@ -2652,12 +2736,13 @@ AC_DEFUN(SC_TCL_CFG_ENCODING, [
else
AC_DEFINE(TCL_CFGVAL_ENCODING,"iso8859-1",
[What encoding should be used for embedded configuration info?])
- fi])
+ fi
+])
#--------------------------------------------------------------------
# SC_TCL_CHECK_BROKEN_FUNC
#
-# Declare the encoding to use for embedded configuration information.
+# Check for broken function.
#
# Arguments:
# funcName - function to test for
@@ -2673,11 +2758,9 @@ AC_DEFUN(SC_TCL_CFG_ENCODING, [
AC_DEFUN(SC_TCL_CHECK_BROKEN_FUNC,[
AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0)
if test ["$tcl_ok"] = 1; then
- AC_MSG_CHECKING([proper ]$1[ implementation])
- AC_CACHE_VAL([tcl_cv_]$1[_unbroken],
+ AC_CACHE_CHECK([proper ]$1[ implementation], [tcl_cv_]$1[_unbroken],
AC_TRY_RUN([[int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
[tcl_cv_]$1[_unbroken]=broken,[tcl_cv_]$1[_unbroken]=unknown))
- AC_MSG_RESULT([$tcl_cv_]$1[_unbroken])
if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then
tcl_ok=1
else
@@ -2687,7 +2770,8 @@ AC_DEFUN(SC_TCL_CHECK_BROKEN_FUNC,[
if test ["$tcl_ok"] = 0; then
AC_LIBOBJ($1)
USE_COMPAT=1
- fi])
+ fi
+])
# Local Variables: