2 #--------------------------------------------------------------------
3 # Sample configure.in for Tcl Extensions. The only places you should
4 # need to modify this file are marked by the string __CHANGE__
5 #--------------------------------------------------------------------
7 #-----------------------------------------------------------------------
8 # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
9 # set as provided. These will also be added as -D defs in your Makefile
10 # so you can encode the package version directly into the source files.
11 #-----------------------------------------------------------------------
13 AC_INIT([itcl], [3.3])
15 #--------------------------------------------------------------------
16 # Call TEA_INIT as the first TEA_ macro to set up initial vars.
17 # This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
18 # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
19 #--------------------------------------------------------------------
25 if test ! -d $srcdir/tclconfig ; then
26 if test -d $srcdir/../tclconfig ; then
27 $LN_S $srcdir/../tclconfig tclconfig
28 CONFIG_CLEAN_FILES=tclconfig
31 AC_SUBST(CONFIG_CLEAN_FILES)
33 AC_CONFIG_AUX_DIR(tclconfig)
35 #--------------------------------------------------------------------
36 # Load the tclConfig.sh file
37 #--------------------------------------------------------------------
42 #-----------------------------------------------------------------------
43 # Handle the --prefix=... option by defaulting to what Tcl gave.
44 # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
45 #-----------------------------------------------------------------------
49 #-----------------------------------------------------------------------
50 # Standard compiler checks.
51 # This sets up CC by using the CC env var, or looks for gcc otherwise.
52 # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create
53 # the basic setup necessary to compile executables.
54 #-----------------------------------------------------------------------
58 #-----------------------------------------------------------------------
60 # Specify the C source files to compile in TEA_ADD_SOURCES,
61 # public headers that need to be installed in TEA_ADD_HEADERS,
62 # stub library C source files to compile in TEA_ADD_STUB_SOURCES,
63 # and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
64 # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
65 # and PKG_TCL_SOURCES.
66 #-----------------------------------------------------------------------
68 TEA_ADD_SOURCES([itclStubInit.c
79 TEA_ADD_HEADERS([generic/itcl.h
82 generic/itclIntDecls.h])
83 TEA_ADD_INCLUDES([-I\"`${CYGPATH} ${srcdir}/generic`\"])
86 TEA_ADD_STUB_SOURCES([itclStubLib.c])
87 TEA_ADD_TCL_SOURCES([library/itcl.tcl])
89 #--------------------------------------------------------------------
91 # A few miscellaneous platform-specific items:
93 # Define a special symbol for Windows (BUILD_itcl in this case) so
94 # that we create the export library with the dll. See sha1.h on how
97 # Windows creates a few extra files that need to be cleaned up.
98 # You can add more files to clean if your extension creates any extra
101 # Define any extra compiler flags in the PACKAGE_CFLAGS variable.
102 # These will be appended to the current set of compiler flags for
104 #--------------------------------------------------------------------
106 if test "${TEA_PLATFORM}" = "windows" ; then
107 AC_DEFINE(BUILD_itcl)
108 CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch"
109 TEA_ADD_SOURCES([dllEntryPoint.c])
117 #--------------------------------------------------------------------
119 # Choose which headers you need. Extension authors should try very
120 # hard to only rely on the Tcl public header files. Internal headers
121 # contain private data structures and are subject to change without
123 # This must be done AFTER calling TEA_PATH_TCLCONFIG/TEA_LOAD_TCLCONFIG
124 # so that we can extract TCL_SRC_DIR from the config file (in the case
126 #--------------------------------------------------------------------
128 #TEA_PUBLIC_TCL_HEADERS
129 TEA_PRIVATE_TCL_HEADERS
131 #--------------------------------------------------------------------
132 # We need to enable the threading macros found in tcl.h and tclInt.h.
133 # The use of the threading features is determined by the core the
134 # extension is loaded into, but we need to compile with these macros
136 #--------------------------------------------------------------------
138 AC_DEFINE(TCL_THREADS)
140 #--------------------------------------------------------------------
141 # Check whether --enable-threads or --disable-threads was given.
142 # This auto-enables if Tcl was compiled threaded.
143 #--------------------------------------------------------------------
147 #--------------------------------------------------------------------
148 # The statement below defines a collection of symbols related to
149 # building as a shared library instead of a static library.
150 #--------------------------------------------------------------------
154 #--------------------------------------------------------------------
155 # This macro figures out what flags to use with the compiler/linker
156 # when building shared/static debug/optimized objects. This information
157 # can be taken from the tclConfig.sh file, but this figures it all out.
158 #--------------------------------------------------------------------
162 #--------------------------------------------------------------------
163 # Set the default compiler switches based on the --enable-symbols
165 #--------------------------------------------------------------------
169 #--------------------------------------------------------------------
170 # Everyone should be linking against the Tcl stub library. If you
171 # can't for some reason, remove this definition. If you aren't using
172 # stubs, you also need to modify the SHLIB_LD_LIBS setting below to
173 # link against the non-stubbed Tcl library.
174 #--------------------------------------------------------------------
176 if test "${SHARED_BUILD}" = "1" ; then
177 AC_DEFINE(USE_TCL_STUBS)
180 #--------------------------------------------------------------------
181 # This macro generates a line to use when building a library. It
182 # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
183 # and TEA_LOAD_TCLCONFIG macros above.
184 #--------------------------------------------------------------------
188 #--------------------------------------------------------------------
190 # Change the name from exampeA_LIB_FILE to match your package name.
191 # Use the stub_LIB_FILE substitution if your package creates a stub
193 #--------------------------------------------------------------------
195 itcl_STUB_LIB_FILE=${PKG_STUB_LIB_FILE}
196 itcl_LIB_FILE=${PKG_LIB_FILE}
197 AC_SUBST(itcl_STUB_LIB_FILE)
198 AC_SUBST(itcl_LIB_FILE)
200 #--------------------------------------------------------------------
201 # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl
202 # file during the install process. Don't run the TCLSH_PROG through
203 # ${CYGPATH} because it's being used directly by make.
204 # Require that we use a tclsh shell version 8.2 or later since earlier
205 # versions have bugs in the pkg_mkIndex routine.
206 #--------------------------------------------------------------------
210 #--------------------------------------------------------------------
211 # These are for itclConfig.sh
212 #--------------------------------------------------------------------
214 # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib)
215 eval pkglibdir="${libdir}/${PACKAGE_NAME}${PACKAGE_VERSION}"
216 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
217 eval itcl_LIB_FLAG="-litcl${PACKAGE_VERSION}${DBGX}"
218 eval itcl_STUB_LIB_FLAG="-litclstub${PACKAGE_VERSION}${DBGX}"
220 eval itcl_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
221 eval itcl_STUB_LIB_FLAG="-litclstub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}"
223 itcl_BUILD_LIB_SPEC="-L`pwd` ${itcl_LIB_FLAG}"
224 itcl_LIB_SPEC="-L${pkglibdir} ${itcl_LIB_FLAG}"
226 itcl_BUILD_STUB_LIB_SPEC="-L`pwd` ${itcl_STUB_LIB_FLAG}"
227 itcl_STUB_LIB_SPEC="-L${pkglibdir} ${itcl_STUB_LIB_FLAG}"
228 itcl_BUILD_STUB_LIB_PATH="`pwd`/${itcl_STUB_LIB_FILE}"
229 itcl_STUB_LIB_PATH="${pkglibdir}/${itcl_STUB_LIB_FILE}"
231 AC_SUBST(itcl_BUILD_LIB_SPEC)
232 AC_SUBST(itcl_LIB_SPEC)
233 AC_SUBST(itcl_BUILD_STUB_LIB_SPEC)
234 AC_SUBST(itcl_STUB_LIB_SPEC)
235 AC_SUBST(itcl_BUILD_STUB_LIB_PATH)
236 AC_SUBST(itcl_STUB_LIB_PATH)
238 # itcl_SRC_DIR must be a fully qualified path
239 eval itcl_SRC_DIR="$srcdir"
240 itcl_SRC_DIR=`cd "${itcl_SRC_DIR}"; pwd`
241 AC_SUBST(itcl_SRC_DIR)
243 #--------------------------------------------------------------------
244 # Finally, substitute all of the various values into the Makefile.
245 #--------------------------------------------------------------------
247 AC_OUTPUT([Makefile pkgIndex.tcl itclConfig.sh])