tclconfig update
authorJean-Claude Wippler <jcw@equi4.com>
Thu, 28 Dec 2006 17:29:49 +0000 (17:29 +0000)
committerJean-Claude Wippler <jcw@equi4.com>
Thu, 28 Dec 2006 17:29:49 +0000 (17:29 +0000)
ChangeLog
configure
tclconfig/tcl.m4

index f61dea445b49729f873996efcd46929d97996f46..4e6c0bbaacb19900d5f9d78db43693495cdd3227 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-12-28  Jean-Claude Wippler  <jcw@equi4.com>
+
+       * configure: autoconf 2.59
+       * tclconfig/tcl.m4: based on tcl.m4,v 1.97 2006/12/19 01:20:55 das
+
 2006-12-10  Steve Huntley  <stephen.huntley@alum.mit.edu>
 
        * library/template/versionvfs.tcl: when time attribute is set,
index db5a9afad4bd508e234d17d83914ff03e2c3e86a..19610fc65681ee00f151c980f5eea4f9d8915052 100755 (executable)
--- a/configure
+++ b/configure
@@ -846,8 +846,8 @@ Optional Features:
   --enable-64bit          enable 64bit support (default: off)
   --enable-64bit-vis      enable 64bit Sparc VIS support (default: off)
   --enable-wince          enable Win/CE support (where applicable)
-  --disable-load          disallow dynamic loading and "load" command
-                          (default: enabled)
+  --enable-load           allow dynamic loading and "load" command (default:
+                          on)
   --enable-symbols        build with debugging symbols (default: off)
 
 Optional Packages:
@@ -4566,7 +4566,8 @@ echo $ECHO_N "checking dirent.h... $ECHO_C" >&6
 if test "${tcl_cv_dirent_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -6851,7 +6852,7 @@ echo "$as_me: WARNING: can't find uname command" >&2;}
                # 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 }' /etc/.relid`
+                   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`
@@ -7844,7 +7845,8 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
            # get rid of the warnings.
            #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
 
-           SHLIB_LD="${CC} -shared"
+           # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
+           SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
            DL_OBJS="tclLoadDl.o"
            DL_LIBS="-ldl"
            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
@@ -7853,6 +7855,70 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
            if test "`uname -m`" = "alpha" ; then
                CFLAGS="$CFLAGS -mieee"
            fi
+           if test $do64bit = yes; then
+               echo "$as_me:$LINENO: checking if compiler accepts -m64 flag" >&5
+echo $ECHO_N "checking if compiler accepts -m64 flag... $ECHO_C" >&6
+if test "${tcl_cv_cc_m64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+                   hold_cflags=$CFLAGS
+                   CFLAGS="$CFLAGS -m64"
+                   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  tcl_cv_cc_m64=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_m64=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+                   CFLAGS=$hold_cflags
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_cc_m64" >&5
+echo "${ECHO_T}$tcl_cv_cc_m64" >&6
+               if test $tcl_cv_cc_m64 = yes; then
+                   CFLAGS="$CFLAGS -m64"
+                   do64bit_ok=yes
+               fi
+           fi
 
            # The combo of gcc + glibc has a bug related
            # to inlining of functions like strtod(). The
@@ -7918,7 +7984,7 @@ echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;}
            # NetBSD/SPARC needs -fPIC, -fpic will not do.
            SHLIB_CFLAGS="-fPIC"
            SHLIB_LD="ld -Bshareable -x"
-           SHLIB_LD_LIBS=""
+           SHLIB_LD_LIBS='${LIBS}'
            SHLIB_SUFFIX=".so"
            DL_OBJS="tclLoadDl.o"
            DL_LIBS=""
@@ -8049,8 +8115,142 @@ echo "${ECHO_T}$tcl_cv_ld_elf" >&6
            CFLAGS_OPTIMIZE="-Os"
            SHLIB_CFLAGS="-fno-common"
            if test $do64bit = yes; then
-               do64bit_ok=yes
-               CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+               case `arch` in
+                   ppc)
+                       echo "$as_me:$LINENO: checking if compiler accepts -arch ppc64 flag" >&5
+echo $ECHO_N "checking if compiler accepts -arch ppc64 flag... $ECHO_C" >&6
+if test "${tcl_cv_cc_arch_ppc64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+                           hold_cflags=$CFLAGS
+                           CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+                           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  tcl_cv_cc_arch_ppc64=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_arch_ppc64=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+                           CFLAGS=$hold_cflags
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_ppc64" >&5
+echo "${ECHO_T}$tcl_cv_cc_arch_ppc64" >&6
+                       if test $tcl_cv_cc_arch_ppc64 = yes; then
+                           CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+                           do64bit_ok=yes
+                       fi;;
+                   i386)
+                       echo "$as_me:$LINENO: checking if compiler accepts -arch x86_64 flag" >&5
+echo $ECHO_N "checking if compiler accepts -arch x86_64 flag... $ECHO_C" >&6
+if test "${tcl_cv_cc_arch_x86_64+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+                           hold_cflags=$CFLAGS
+                           CFLAGS="$CFLAGS -arch x86_64"
+                           cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  tcl_cv_cc_arch_x86_64=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+tcl_cv_cc_arch_x86_64=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+                           CFLAGS=$hold_cflags
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_cc_arch_x86_64" >&5
+echo "${ECHO_T}$tcl_cv_cc_arch_x86_64" >&6
+                       if test $tcl_cv_cc_arch_x86_64 = yes; then
+                           CFLAGS="$CFLAGS -arch x86_64"
+                           do64bit_ok=yes
+                       fi;;
+                   *)
+                       { echo "$as_me:$LINENO: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&5
+echo "$as_me: WARNING: Don't know how enable 64-bit on architecture \`arch\`" >&2;};;
+               esac
+           else
+               # Check for combined 32-bit and 64-bit fat build
+               echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \
+                   echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \
+                   fat_32_64=yes
            fi
            # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
            SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
@@ -8060,9 +8260,9 @@ if test "${tcl_cv_ld_single_module+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-               hold_ldflags=$LDFLAGS
-               LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
-               cat >conftest.$ac_ext <<_ACEOF
+               hold_ldflags=$LDFLAGS
+               LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8108,20 +8308,20 @@ tcl_cv_ld_single_module=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-               LDFLAGS=$hold_ldflags
+               LDFLAGS=$hold_ldflags
 fi
 echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5
 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6
            if test $tcl_cv_ld_single_module = yes; then
-               SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+               SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
            fi
            SHLIB_LD_LIBS='${LIBS}'
            SHLIB_SUFFIX=".dylib"
            DL_OBJS="tclLoadDyld.o"
            DL_LIBS=""
            # Don't use -prebind when building for Mac OS X 10.4 or later only:
-           test -z "${MACOSX_DEPLOYMENT_TARGET}" || \
-               test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \
+           test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int($2)}'`" -lt 4 -a \
+               "`echo "${CFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int($2)}'`" -lt 4 && \
                LDFLAGS="$LDFLAGS -prebind"
            LDFLAGS="$LDFLAGS -headerpad_max_install_names"
            echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5
@@ -8130,9 +8330,9 @@ if test "${tcl_cv_ld_search_paths_first+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-               hold_ldflags=$LDFLAGS
-               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
-               cat >conftest.$ac_ext <<_ACEOF
+               hold_ldflags=$LDFLAGS
+               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8178,22 +8378,22 @@ tcl_cv_ld_search_paths_first=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-               LDFLAGS=$hold_ldflags
+               LDFLAGS=$hold_ldflags
 fi
 echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5
 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6
            if test $tcl_cv_ld_search_paths_first = yes; then
-               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
            fi
            CC_SEARCH_FLAGS=""
            LD_SEARCH_FLAGS=""
            LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
 
-           # TEA specific: for Tk extensions, remove -arch ppc64 from CFLAGS
-           # for fat builds, as neither TkAqua nor TkX11 can be built for 64bit
-           # at present (no 64bit GUI libraries).
-           test $do64bit_ok = no && test -n "${TK_BIN_DIR}" && \
-               CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
+           # TEA specific: for Tk extensions, remove 64-bit arch flags from
+           # CFLAGS for combined 32-bit and 64-bit fat builds as neither TkAqua
+           # nor TkX11 can be built for 64-bit at present.
+           test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && \
+               CFLAGS="`echo "$CFLAGS " | sed -e 's/-arch ppc64 / /g' -e 's/-arch x86_64 / /g'`"
            ;;
        NEXTSTEP-*)
            SHLIB_CFLAGS=""
@@ -9467,6 +9667,9 @@ _ACEOF
        fi
        # Some packages build their own stubs libraries
        eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+       if test "$GCC" = "yes"; then
+           PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+       fi
        # These aren't needed on Windows (either MSVC or gcc)
        RANLIB=:
        RANLIB_STUB=:
index 9c0337a7c07324e3434c07214a8156e34d0c12f4..f891eb87ca8ec058ced9ea14d643091e0ab291ff 100644 (file)
@@ -13,7 +13,7 @@
 
 AC_PREREQ(2.50)
 
-dnl TEA extensions pass this us the version of TEA they think they
+dnl TEA extensions pass us the version of TEA they think they
 dnl are compatible with (must be set in TEA_INIT below)
 dnl TEA_VERSION="3.5"
 
@@ -42,7 +42,7 @@ dnl TEA_VERSION="3.5"
 #                              the tclConfig.sh file
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PATH_TCLCONFIG, [
+AC_DEFUN([TEA_PATH_TCLCONFIG], [
     dnl Make sure we are initialized
     AC_REQUIRE([TEA_INIT])
     #
@@ -187,7 +187,7 @@ AC_DEFUN(TEA_PATH_TCLCONFIG, [
 #                              the tkConfig.sh file
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PATH_TKCONFIG, [
+AC_DEFUN([TEA_PATH_TKCONFIG], [
     #
     # Ok, lets find the tk configuration
     # First, look for one uninstalled.
@@ -274,12 +274,12 @@ AC_DEFUN(TEA_PATH_TKCONFIG, [
 
            # on Windows, check in common installation locations
            if test "${TEA_PLATFORM}" = "windows" \
-               -a x"${ac_cv_c_tclconfig}" = x ; then
+               -a x"${ac_cv_c_tkconfig}" = x ; then
                for i in `ls -d C:/Tcl/lib 2>/dev/null` \
                        `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \
                        ; do
-                   if test -f "$i/tclConfig.sh" ; then
-                       ac_cv_c_tclconfig=`(cd $i; pwd)`
+                   if test -f "$i/tkConfig.sh" ; then
+                       ac_cv_c_tkconfig=`(cd $i; pwd)`
                        break
                    fi
                done
@@ -331,7 +331,7 @@ AC_DEFUN(TEA_PATH_TKCONFIG, [
 #
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_LOAD_TCLCONFIG, [
+AC_DEFUN([TEA_LOAD_TCLCONFIG], [
     AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
 
     if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
@@ -419,7 +419,7 @@ AC_DEFUN(TEA_LOAD_TCLCONFIG, [
 #              TK_BIN_DIR
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_LOAD_TKCONFIG, [
+AC_DEFUN([TEA_LOAD_TKCONFIG], [
     AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
 
     if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
@@ -524,7 +524,7 @@ AC_DEFUN(TEA_LOAD_TKCONFIG, [
 #              SHARED_BUILD    Value of 1 or 0
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_ENABLE_SHARED, [
+AC_DEFUN([TEA_ENABLE_SHARED], [
     AC_MSG_CHECKING([how to build libraries])
     AC_ARG_ENABLE(shared,
        AC_HELP_STRING([--enable-shared],
@@ -582,7 +582,7 @@ AC_DEFUN(TEA_ENABLE_SHARED, [
 #
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_ENABLE_THREADS, [
+AC_DEFUN([TEA_ENABLE_THREADS], [
     AC_ARG_ENABLE(threads,
        AC_HELP_STRING([--enable-threads],
            [build with threads]),
@@ -711,7 +711,7 @@ AC_DEFUN(TEA_ENABLE_THREADS, [
 #
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_ENABLE_SYMBOLS, [
+AC_DEFUN([TEA_ENABLE_SYMBOLS], [
     dnl Make sure we are initialized
     AC_REQUIRE([TEA_CONFIG_CFLAGS])
     AC_MSG_CHECKING([for build with symbols])
@@ -771,7 +771,7 @@ AC_DEFUN(TEA_ENABLE_SYMBOLS, [
 #
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_ENABLE_LANGINFO, [
+AC_DEFUN([TEA_ENABLE_LANGINFO], [
     AC_ARG_ENABLE(langinfo,
        AC_HELP_STRING([--enable-langinfo],
            [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]),
@@ -783,9 +783,9 @@ AC_DEFUN(TEA_ENABLE_LANGINFO, [
     fi
     AC_MSG_CHECKING([whether to use nl_langinfo])
     if test "$langinfo_ok" = "yes"; then
-       AC_CACHE_VAL(tcl_cv_langinfo_h,
+       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]))
+                   [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])])
        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()?])
@@ -813,7 +813,7 @@ AC_DEFUN(TEA_ENABLE_LANGINFO, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_CONFIG_SYSTEM, [
+AC_DEFUN([TEA_CONFIG_SYSTEM], [
     AC_CACHE_CHECK([system version], tcl_cv_sys_version, [
        if test "${TEA_PLATFORM}" = "windows" ; then
            tcl_cv_sys_version=windows
@@ -829,7 +829,7 @@ AC_DEFUN(TEA_CONFIG_SYSTEM, [
                # 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`
+                   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`
@@ -916,7 +916,7 @@ AC_DEFUN(TEA_CONFIG_SYSTEM, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_CONFIG_CFLAGS, [
+AC_DEFUN([TEA_CONFIG_CFLAGS], [
     dnl Make sure we are initialized
     AC_REQUIRE([TEA_INIT])
 
@@ -1447,7 +1447,8 @@ dnl AC_CHECK_TOOL(AR, ar)
            # get rid of the warnings.
            #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
 
-           SHLIB_LD="${CC} -shared"
+           # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
+           SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS_DEFAULT}'
            DL_OBJS="tclLoadDl.o"
            DL_LIBS="-ldl"
            LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
@@ -1456,6 +1457,17 @@ dnl AC_CHECK_TOOL(AR, ar)
            if test "`uname -m`" = "alpha" ; then
                CFLAGS="$CFLAGS -mieee"
            fi
+           if test $do64bit = yes; then
+               AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [
+                   hold_cflags=$CFLAGS
+                   CFLAGS="$CFLAGS -m64"
+                   AC_TRY_LINK(,, tcl_cv_cc_m64=yes, tcl_cv_cc_m64=no)
+                   CFLAGS=$hold_cflags])
+               if test $tcl_cv_cc_m64 = yes; then
+                   CFLAGS="$CFLAGS -m64"
+                   do64bit_ok=yes
+               fi
+           fi
 
            # The combo of gcc + glibc has a bug related
            # to inlining of functions like strtod(). The
@@ -1521,7 +1533,7 @@ dnl AC_CHECK_TOOL(AR, ar)
            # NetBSD/SPARC needs -fPIC, -fpic will not do.
            SHLIB_CFLAGS="-fPIC"
            SHLIB_LD="ld -Bshareable -x"
-           SHLIB_LD_LIBS=""
+           SHLIB_LD_LIBS='${LIBS}'
            SHLIB_SUFFIX=".so"
            DL_OBJS="tclLoadDl.o"
            DL_LIBS=""
@@ -1606,45 +1618,76 @@ dnl AC_CHECK_TOOL(AR, ar)
            CFLAGS_OPTIMIZE="-Os"
            SHLIB_CFLAGS="-fno-common"
            if test $do64bit = yes; then
-               do64bit_ok=yes
-               CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+               case `arch` in
+                   ppc)
+                       AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag],
+                               tcl_cv_cc_arch_ppc64, [
+                           hold_cflags=$CFLAGS
+                           CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+                           AC_TRY_LINK(,, tcl_cv_cc_arch_ppc64=yes,
+                                   tcl_cv_cc_arch_ppc64=no)
+                           CFLAGS=$hold_cflags])
+                       if test $tcl_cv_cc_arch_ppc64 = yes; then
+                           CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5"
+                           do64bit_ok=yes
+                       fi;;
+                   i386)
+                       AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag],
+                               tcl_cv_cc_arch_x86_64, [
+                           hold_cflags=$CFLAGS
+                           CFLAGS="$CFLAGS -arch x86_64"
+                           AC_TRY_LINK(,, tcl_cv_cc_arch_x86_64=yes,
+                                   tcl_cv_cc_arch_x86_64=no)
+                           CFLAGS=$hold_cflags])
+                       if test $tcl_cv_cc_arch_x86_64 = yes; then
+                           CFLAGS="$CFLAGS -arch x86_64"
+                           do64bit_ok=yes
+                       fi;;
+                   *)
+                       AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);;
+               esac
+           else
+               # Check for combined 32-bit and 64-bit fat build
+               echo "$CFLAGS " | grep -E -q -- '-arch (ppc64|x86_64) ' && \
+                   echo "$CFLAGS " | grep -E -q -- '-arch (ppc|i386) ' && \
+                   fat_32_64=yes
            fi
            # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS here:
            SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}'
            AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [
-               hold_ldflags=$LDFLAGS
-               LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
-               AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
-               LDFLAGS=$hold_ldflags])
+               hold_ldflags=$LDFLAGS
+               LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module"
+               AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no)
+               LDFLAGS=$hold_ldflags])
            if test $tcl_cv_ld_single_module = yes; then
-               SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
+               SHLIB_LD="${SHLIB_LD} -Wl,-single_module"
            fi
            SHLIB_LD_LIBS='${LIBS}'
            SHLIB_SUFFIX=".dylib"
            DL_OBJS="tclLoadDyld.o"
            DL_LIBS=""
            # Don't use -prebind when building for Mac OS X 10.4 or later only:
-           test -z "${MACOSX_DEPLOYMENT_TARGET}" || \
-               test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print [$]2}'`" -lt 4 && \
+           test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F '10\\.' '{print int([$]2)}'`" -lt 4 -a \
+               "`echo "${CFLAGS}" | awk -F '-mmacosx-version-min=10\\.' '{print int([$]2)}'`" -lt 4 && \
                LDFLAGS="$LDFLAGS -prebind"
            LDFLAGS="$LDFLAGS -headerpad_max_install_names"
            AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [
-               hold_ldflags=$LDFLAGS
-               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
-               AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
-               LDFLAGS=$hold_ldflags])
+               hold_ldflags=$LDFLAGS
+               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+               AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no)
+               LDFLAGS=$hold_ldflags])
            if test $tcl_cv_ld_search_paths_first = yes; then
-               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
+               LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
            fi
            CC_SEARCH_FLAGS=""
            LD_SEARCH_FLAGS=""
            LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH"
 
-           # TEA specific: for Tk extensions, remove -arch ppc64 from CFLAGS
-           # for fat builds, as neither TkAqua nor TkX11 can be built for 64bit
-           # at present (no 64bit GUI libraries).
-           test $do64bit_ok = no && test -n "${TK_BIN_DIR}" && \
-               CFLAGS="`echo "$CFLAGS" | sed -e 's/-arch ppc64/-arch ppc/g'`"
+           # TEA specific: for Tk extensions, remove 64-bit arch flags from
+           # CFLAGS for combined 32-bit and 64-bit fat builds as neither TkAqua
+           # nor TkX11 can be built for 64-bit at present.
+           test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}" && \
+               CFLAGS="`echo "$CFLAGS " | sed -e 's/-arch ppc64 / /g' -e 's/-arch x86_64 / /g'`"
            ;;
        NEXTSTEP-*)
            SHLIB_CFLAGS=""
@@ -1916,8 +1959,8 @@ dnl AC_CHECK_TOOL(AR, ar)
     # Step 4: disable dynamic loading if requested via a command-line switch.
 
     AC_ARG_ENABLE(load,
-       AC_HELP_STRING([--disable-load],
-           [disallow dynamic loading and "load" command (default: enabled)]),
+       AC_HELP_STRING([--enable-load],
+           [allow dynamic loading and "load" command (default: on)]),
        [tcl_ok=$enableval], [tcl_ok=yes])
     if test "$tcl_ok" = "no"; then
        DL_OBJS=""
@@ -2017,7 +2060,7 @@ dnl AC_CHECK_TOOL(AR, ar)
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_SERIAL_PORT, [
+AC_DEFUN([TEA_SERIAL_PORT], [
     AC_CHECK_HEADERS(sys/modem.h)
     AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [
     AC_TRY_RUN([
@@ -2145,8 +2188,8 @@ int main() {
 # CHECK on limits.h
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_MISSING_POSIX_HEADERS, [
-    AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h,
+AC_DEFUN([TEA_MISSING_POSIX_HEADERS], [
+    AC_CACHE_CHECK([dirent.h], tcl_cv_dirent_h, [
     AC_TRY_LINK([#include <sys/types.h>
 #include <dirent.h>], [
 #ifndef _POSIX_SOURCE
@@ -2166,7 +2209,7 @@ d = opendir("foobar");
 entryPtr = readdir(d);
 p = entryPtr->d_name;
 closedir(d);
-], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no))
+], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)])
 
     if test $tcl_cv_dirent_h = no; then
        AC_DEFINE(NO_DIRENT_H, 1, [Do we have <dirent.h>?])
@@ -2228,13 +2271,13 @@ closedir(d);
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_PATH_X, [
+AC_DEFUN([TEA_PATH_X], [
     if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then
        TEA_PATH_UNIX_X
     fi
 ])
 
-AC_DEFUN(TEA_PATH_UNIX_X, [
+AC_DEFUN([TEA_PATH_UNIX_X], [
     AC_PATH_X
     not_really_there=""
     if test "$no_x" = ""; then
@@ -2323,7 +2366,7 @@ AC_DEFUN(TEA_PATH_UNIX_X, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_BLOCKING_STYLE, [
+AC_DEFUN([TEA_BLOCKING_STYLE], [
     AC_CHECK_HEADERS(sys/ioctl.h)
     AC_CHECK_HEADERS(sys/filio.h)
     TEA_CONFIG_SYSTEM
@@ -2367,23 +2410,23 @@ AC_DEFUN(TEA_BLOCKING_STYLE, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_TIME_HANDLER, [
+AC_DEFUN([TEA_TIME_HANDLER], [
     AC_CHECK_HEADERS(sys/time.h)
     AC_HEADER_TIME
     AC_STRUCT_TIMEZONE
 
     AC_CHECK_FUNCS(gmtime_r localtime_r)
 
-    AC_CACHE_CHECK([tm_tzadj in struct tm], 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))
+           tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)])
     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_CACHE_CHECK([tm_gmtoff in struct tm], 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))
+           tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
     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
@@ -2392,24 +2435,24 @@ AC_DEFUN(TEA_TIME_HANDLER, [
     # Its important to include time.h in this check, as some systems
     # (like convex) have timezone functions, etc.
     #
-    AC_CACHE_CHECK([long timezone variable], 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))
+           tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)])
     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_CACHE_CHECK([time_t timezone variable], 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))
+               tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)])
        if test $tcl_cv_timezone_time = yes ; then
            AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?])
        fi
@@ -2436,7 +2479,7 @@ AC_DEFUN(TEA_TIME_HANDLER, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_BUGGY_STRTOD, [
+AC_DEFUN([TEA_BUGGY_STRTOD], [
     AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
     if test "$tcl_strtod" = 1; then
        AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
@@ -2496,7 +2539,7 @@ AC_DEFUN(TEA_BUGGY_STRTOD, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_TCL_LINK_LIBS, [
+AC_DEFUN([TEA_TCL_LINK_LIBS], [
     #--------------------------------------------------------------------
     # On a few very rare systems, all of the libm.a stuff is
     # already in libc.a.  Set compiler flags accordingly.
@@ -2574,7 +2617,7 @@ AC_DEFUN(TEA_TCL_LINK_LIBS, [
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_TCL_EARLY_FLAG,[
+AC_DEFUN([TEA_TCL_EARLY_FLAG],[
     AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
        AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,
            AC_TRY_COMPILE([[#define ]$1[ 1
@@ -2587,7 +2630,7 @@ AC_DEFUN(TEA_TCL_EARLY_FLAG,[
     fi
 ])
 
-AC_DEFUN(TEA_TCL_EARLY_FLAGS,[
+AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
     AC_MSG_CHECKING([for required early compiler flags])
     tcl_flags=""
     TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
@@ -2622,7 +2665,7 @@ AC_DEFUN(TEA_TCL_EARLY_FLAGS,[
 #
 #--------------------------------------------------------------------
 
-AC_DEFUN(TEA_TCL_64BIT_FLAGS, [
+AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
     AC_MSG_CHECKING([for 64-bit integer type])
     AC_CACHE_VAL(tcl_cv_type_64bit,[
        tcl_cv_type_64bit=none
@@ -2718,7 +2761,7 @@ AC_DEFUN(TEA_TCL_64BIT_FLAGS, [
 #      a compiler.
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_INIT, [
+AC_DEFUN([TEA_INIT], [
     # TEA extensions pass this us the version of TEA they think they
     # are compatible with.
     TEA_VERSION="3.5"
@@ -2794,7 +2837,7 @@ TEA version not specified.])
 #              PKG_SOURCES
 #              PKG_OBJECTS
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_SOURCES, [
+AC_DEFUN([TEA_ADD_SOURCES], [
     vars="$@"
     for i in $vars; do
        case $i in
@@ -2844,7 +2887,7 @@ AC_DEFUN(TEA_ADD_SOURCES, [
 #              PKG_STUB_SOURCES
 #              PKG_STUB_OBJECTS
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_STUB_SOURCES, [
+AC_DEFUN([TEA_ADD_STUB_SOURCES], [
     vars="$@"
     for i in $vars; do
        # check for existence - allows for generic/win/unix VPATH
@@ -2882,7 +2925,7 @@ AC_DEFUN(TEA_ADD_STUB_SOURCES, [
 #      Defines and substs the following vars:
 #              PKG_TCL_SOURCES
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_TCL_SOURCES, [
+AC_DEFUN([TEA_ADD_TCL_SOURCES], [
     vars="$@"
     for i in $vars; do
        # check for existence, be strict because it is installed
@@ -2908,7 +2951,7 @@ AC_DEFUN(TEA_ADD_TCL_SOURCES, [
 #      Defines and substs the following vars:
 #              PKG_HEADERS
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_HEADERS, [
+AC_DEFUN([TEA_ADD_HEADERS], [
     vars="$@"
     for i in $vars; do
        # check for existence, be strict because it is installed
@@ -2934,7 +2977,7 @@ AC_DEFUN(TEA_ADD_HEADERS, [
 #      Defines and substs the following vars:
 #              PKG_INCLUDES
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_INCLUDES, [
+AC_DEFUN([TEA_ADD_INCLUDES], [
     vars="$@"
     for i in $vars; do
        PKG_INCLUDES="$PKG_INCLUDES $i"
@@ -2958,7 +3001,7 @@ AC_DEFUN(TEA_ADD_INCLUDES, [
 #      Defines and substs the following vars:
 #              PKG_LIBS
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_LIBS, [
+AC_DEFUN([TEA_ADD_LIBS], [
     vars="$@"
     for i in $vars; do
        if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then
@@ -2984,7 +3027,7 @@ AC_DEFUN(TEA_ADD_LIBS, [
 #      Defines and substs the following vars:
 #              PKG_CFLAGS
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_ADD_CFLAGS, [
+AC_DEFUN([TEA_ADD_CFLAGS], [
     PKG_CFLAGS="$PKG_CFLAGS $@"
     AC_SUBST(PKG_CFLAGS)
 ])
@@ -3003,7 +3046,7 @@ AC_DEFUN(TEA_ADD_CFLAGS, [
 #      $exec_prefix will be set to the values given to Tcl when it was
 #      configured.
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_PREFIX, [
+AC_DEFUN([TEA_PREFIX], [
     if test "${prefix}" = "NONE"; then
        prefix_default=yes
        if test x"${TCL_PREFIX}" != x; then
@@ -3039,7 +3082,7 @@ AC_DEFUN(TEA_PREFIX, [
 #
 #      Sets up CC var and other standard bits we need to make executables.
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_SETUP_COMPILER_CC, [
+AC_DEFUN([TEA_SETUP_COMPILER_CC], [
     # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE)
     # in this macro, they need to go into TEA_SETUP_COMPILER instead.
 
@@ -3087,7 +3130,7 @@ AC_DEFUN(TEA_SETUP_COMPILER_CC, [
 #
 #      Sets up CC var and other standard bits we need to make executables.
 #------------------------------------------------------------------------
-AC_DEFUN(TEA_SETUP_COMPILER, [
+AC_DEFUN([TEA_SETUP_COMPILER], [
     # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here.
     AC_REQUIRE([TEA_SETUP_COMPILER_CC])
 
@@ -3142,7 +3185,7 @@ AC_DEFUN(TEA_SETUP_COMPILER, [
 #      MAKE_STUB_LIB   Makefile rule for building a stub library
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_MAKE_LIB, [
+AC_DEFUN([TEA_MAKE_LIB], [
     if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then
        MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)"
        MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)"
@@ -3179,6 +3222,9 @@ AC_DEFUN(TEA_MAKE_LIB, [
        fi
        # Some packages build their own stubs libraries
        eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
+       if test "$GCC" = "yes"; then
+           PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
+       fi
        # These aren't needed on Windows (either MSVC or gcc)
        RANLIB=:
        RANLIB_STUB=:
@@ -3235,7 +3281,7 @@ AC_DEFUN(TEA_MAKE_LIB, [
 #              ${basename}_LIB_SPEC    The computed linker flags.
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_LIB_SPEC, [
+AC_DEFUN([TEA_LIB_SPEC], [
     AC_MSG_CHECKING([for $1 library])
 
     # Look in exec-prefix for the library (defined by TEA_PREFIX).
@@ -3308,7 +3354,7 @@ AC_DEFUN(TEA_LIB_SPEC, [
 #              TCL_INCLUDES
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PRIVATE_TCL_HEADERS, [
+AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
     AC_MSG_CHECKING([for Tcl private include files])
 
     TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}`
@@ -3372,7 +3418,7 @@ AC_DEFUN(TEA_PRIVATE_TCL_HEADERS, [
 #              TCL_INCLUDES
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PUBLIC_TCL_HEADERS, [
+AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [
     AC_MSG_CHECKING([for Tcl public headers])
 
     AC_ARG_WITH(tclinclude, [  --with-tclinclude       directory containing the public Tcl header files], with_tclinclude=${withval})
@@ -3461,7 +3507,7 @@ AC_DEFUN(TEA_PUBLIC_TCL_HEADERS, [
 #              TK_INCLUDES
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PRIVATE_TK_HEADERS, [
+AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [
     AC_MSG_CHECKING([for Tk private include files])
 
     TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}`
@@ -3527,7 +3573,7 @@ AC_DEFUN(TEA_PRIVATE_TK_HEADERS, [
 #              TK_INCLUDES
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PUBLIC_TK_HEADERS, [
+AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [
     AC_MSG_CHECKING([for Tk public headers])
 
     AC_ARG_WITH(tkinclude, [  --with-tkinclude      directory containing the public Tk header files.], with_tkinclude=${withval})
@@ -3629,7 +3675,7 @@ AC_DEFUN(TEA_PUBLIC_TK_HEADERS, [
 #              TCLSH_PROG
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PROG_TCLSH, [
+AC_DEFUN([TEA_PROG_TCLSH], [
     AC_MSG_CHECKING([for tclsh])
     if test -f "${TCL_BIN_DIR}/Makefile" ; then
         # tclConfig.sh is in Tcl build directory
@@ -3679,7 +3725,7 @@ AC_DEFUN(TEA_PROG_TCLSH, [
 #              WISH_PROG
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PROG_WISH, [
+AC_DEFUN([TEA_PROG_WISH], [
     AC_MSG_CHECKING([for wish])
     if test -f "${TK_BIN_DIR}/Makefile" ; then
         # tkConfig.sh is in Tk build directory
@@ -3730,7 +3776,7 @@ AC_DEFUN(TEA_PROG_WISH, [
 #                              the $1Config.sh file
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PATH_CONFIG, [
+AC_DEFUN([TEA_PATH_CONFIG], [
     #
     # Ok, lets find the $1 configuration
     # First, look for one uninstalled.
@@ -3843,7 +3889,7 @@ AC_DEFUN(TEA_PATH_CONFIG, [
 #
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_LOAD_CONFIG, [
+AC_DEFUN([TEA_LOAD_CONFIG], [
     AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
 
     if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
@@ -3899,7 +3945,7 @@ AC_DEFUN(TEA_LOAD_CONFIG, [
 #                              the include and platform lib files
 #------------------------------------------------------------------------
 
-AC_DEFUN(TEA_PATH_CELIB, [
+AC_DEFUN([TEA_PATH_CELIB], [
     # First, look for one uninstalled.
     # the alternative search directory is invoked by --with-celib
 
@@ -3952,5 +3998,3 @@ AC_DEFUN(TEA_PATH_CELIB, [
 # Local Variables:
 # mode: autoconf
 # End:
-
-# BASED ON TEA 1.89 2006/01/25 21:25:02