TEA (tclconfig) Source Code

Practcl and Autoconf
Login

Modifying configure.ac

To utilize practcl, apply the following changes to configure.ac:

--- configure.ac
+++ configure.ac
@@ -23,11 +23,11 @@
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------

-TEA_INIT([3.9])
+TEA_INIT([3.10])

AC_CONFIG_AUX_DIR(tclconfig)

#--------------------------------------------------------------------
# Load the tclConfig.sh file
@@ -181,19 +181,10 @@
# Set the default compiler switches based on the --enable-symbols optio
#--------------------------------------------------------------------

TEA_ENABLE_SYMBOLS

-#--------------------------------------------------------------------
-# Everyone should be linking against the Tcl stub library.  If you
-# can't for some reason, remove this definition.  If you aren't using
-# stubs, you also need to modify the SHLIB_LD_LIBS setting below to
-# link against the non-stubbed Tcl library.  Add Tk too if necessary.
-#--------------------------------------------------------------------
-
-AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
-
#--------------------------------------------------------------------
# Enable compile-time support for TIP #143 and TIP #285.  When using
# a pre-Tcl 8.5 or 8.6 core, respectively, the actual functionality
# will not be available at runtime.
#--------------------------------------------------------------------
@@ -224,6 +215,6 @@
# Finally, substitute all of the various values into the Makefile.
# You may alternatively have a special pkgIndex.tcl.in or other files
# which require substituting th AC variables in.  Include these here.
#--------------------------------------------------------------------

-AC_OUTPUT([Makefile pkgIndex.tcl])
+AC_OUTPUT([Makefile pkgIndex.tcl config.tcl:tclconfig/config.tcl.in])

We remove the hard-coded USE_TCL_STUBS definition because the latest tcl.m4 allows us to control that with the new --disable-stubs options. (Only valid for static builds.) The last line has autoconf perform all of the same substitutions it would have made to the Makefile.in template to a different template: config.tcl.in. The result is a file containing a key/value list that contains all of the same information in a form that is readily accessible to Tcl.