2 # This file is an input file used by the GNU "autoconf" program to
3 # generate the file "configure", which is run during Tcl installation
4 # to configure the system for the local environment.
8 AC_INIT(../generic/tcl.h)
15 VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
18 TCL_DDE_MAJOR_VERSION=1
19 TCL_DDE_MINOR_VERSION=2
20 TCL_DDE_PATCH_LEVEL=""
21 DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION
24 TCL_REG_MAJOR_VERSION=1
25 TCL_REG_MINOR_VERSION=1
26 TCL_REG_PATCH_LEVEL=""
27 REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION
29 #------------------------------------------------------------------------
30 # Handle the --prefix=... option
31 #------------------------------------------------------------------------
33 if test "${prefix}" = "NONE"; then
36 if test "${exec_prefix}" = "NONE"; then
39 # libdir must be a fully qualified path (not ${exec_prefix}/lib)
42 #------------------------------------------------------------------------
43 # Standard compiler checks
44 #------------------------------------------------------------------------
46 # If the user did not set CFLAGS, set it now to keep
47 # the AC_PROG_CC macro from adding "-g -O2".
48 if test "${CFLAGS+set}" != "set" ; then
54 # To properly support cross-compilation, one would
55 # need to use these tool checks instead of
56 # the ones below and reconfigure with
57 # autoconf 2.50. You can also just set
58 # the CC, AR, RANLIB, and RC environment
59 # variables if you want to cross compile.
60 dnl AC_CHECK_TOOL(AR, ar, :)
61 dnl AC_CHECK_TOOL(RANLIB, ranlib, :)
62 dnl AC_CHECK_TOOL(RC, windres, :)
64 if test "${GCC}" = "yes" ; then
65 AC_CHECK_PROG(AR, ar, ar)
66 AC_CHECK_PROG(RANLIB, ranlib, ranlib)
67 AC_CHECK_PROG(RC, windres, windres)
70 #--------------------------------------------------------------------
71 # Checks to see if the make progeam sets the $MAKE variable.
72 #--------------------------------------------------------------------
76 #--------------------------------------------------------------------
77 # Perform additinal compiler tests.
78 #--------------------------------------------------------------------
82 #if test "$ac_cv_cygwin" = "yes" ; then
83 # AC_MSG_ERROR([Compiling with the Cygwin version of gcc is not supported.
84 # Use the Mingw version of gcc from www.mingw.org instead.])
88 AC_CACHE_CHECK(for SEH support in compiler,
91 #define WIN32_LEAN_AND_MEAN
93 #undef WIN32_LEAN_AND_MEAN
95 int main(int argc, char** argv) {
100 __except (EXCEPTION_EXECUTE_HANDLER) {
110 if test "$tcl_cv_seh" = "no" ; then
111 AC_DEFINE(HAVE_NO_SEH, 1,
112 [Defined when mingw does not support SEH])
116 # Check to see if the excpt.h include file provided contains the
117 # definition for EXCEPTION_DISPOSITION; if not, which is the case
118 # with Cygwin's version as of 2002-04-10, define it to be int,
119 # sufficient for getting the current code to work.
121 AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
122 tcl_cv_eh_disposition,
124 #define WIN32_LEAN_AND_MEAN
126 #undef WIN32_LEAN_AND_MEAN
129 EXCEPTION_DISPOSITION x;
131 tcl_cv_eh_disposition=yes,
132 tcl_cv_eh_disposition=no)
134 if test "$tcl_cv_eh_disposition" = "no" ; then
135 AC_DEFINE(EXCEPTION_DISPOSITION, int,
136 [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION])
139 #--------------------------------------------------------------------
140 # Determines the correct binary file extension (.o, .obj, .exe etc.)
141 #--------------------------------------------------------------------
146 #--------------------------------------------------------------------
147 # Check whether --enable-threads or --disable-threads was given.
148 #--------------------------------------------------------------------
152 #--------------------------------------------------------------------
153 # The statements below define a collection of symbols related to
154 # building libtcl as a shared library instead of a static library.
155 #--------------------------------------------------------------------
159 #--------------------------------------------------------------------
160 # The statements below define a collection of compile flags. This
161 # macro depends on the value of SHARED_BUILD, and should be called
162 # after SC_ENABLE_SHARED checks the configure switches.
163 #--------------------------------------------------------------------
167 #--------------------------------------------------------------------
168 # Set the default compiler switches based on the --enable-symbols
169 # option. This macro depends on C flags, and should be called
170 # after SC_CONFIG_CFLAGS macro is called.
171 #--------------------------------------------------------------------
177 #--------------------------------------------------------------------
178 # man2tcl needs this so that it can use errno.h
179 #--------------------------------------------------------------------
181 AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
182 AC_SUBST(MAN2TCLFLAGS)
184 #------------------------------------------------------------------------
185 # tclConfig.sh refers to this by a different name
186 #------------------------------------------------------------------------
188 TCL_SHARED_BUILD=${SHARED_BUILD}
190 #--------------------------------------------------------------------
191 # Perform final evaluations of variables with possible substitutions.
192 #--------------------------------------------------------------------
194 TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
195 TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
196 TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
198 eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\""
200 eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
202 eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}"
203 # FIMXE: These variables decls are missing
205 TCL_BUILD_LIB_SPEC="-L`pwd` -ltcl${VER}${TCL_DBGX}"
208 eval "TCL_STUB_LIB_FILE=\"${LIBPREFIX}tclstub${VER}${LIBSUFFIX}\""
209 eval "TCL_STUB_LIB_FLAG=\"-ltclstub${VER}${TCL_DBGX}\""
210 eval "TCL_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TCL_STUB_LIB_FLAG}\""
211 eval "TCL_STUB_LIB_SPEC=\"-L${libdir} ${TCL_STUB_LIB_FLAG}\""
212 eval "TCL_BUILD_STUB_LIB_PATH=\"`pwd`/${TCL_STUB_LIB_FILE}\""
213 eval "TCL_STUB_LIB_PATH=\"${libdir}/${TCL_STUB_LIB_FILE}\""
215 # Install time header dir can be set via --includedir
216 eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
219 eval "DLLSUFFIX=${DLLSUFFIX}"
220 eval "LIBPREFIX=${LIBPREFIX}"
221 eval "LIBSUFFIX=${LIBSUFFIX}"
222 eval "EXESUFFIX=${EXESUFFIX}"
224 CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}
225 CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}
226 CFG_TCL_EXPORT_FILE_SUFFIX=${TCL_EXPORT_FILE_SUFFIX}
228 #--------------------------------------------------------------------
229 # Adjust the defines for how the resources are built depending
230 # on symbols and static vs. shared.
231 #--------------------------------------------------------------------
233 if test ${SHARED_BUILD} = 0 ; then
234 if test "${DBGX}" = "d"; then
235 RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
237 RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
240 if test "${DBGX}" = "d"; then
241 RC_DEFINES="${RC_DEFINE} DEBUG"
248 AC_SUBST(TCL_VERSION)
249 AC_SUBST(TCL_MAJOR_VERSION)
250 AC_SUBST(TCL_MINOR_VERSION)
251 AC_SUBST(TCL_PATCH_LEVEL)
253 AC_SUBST(TCL_LIB_FILE)
254 AC_SUBST(TCL_LIB_FLAG)
256 AC_SUBST(TCL_LIB_SPEC)
257 AC_SUBST(TCL_STUB_LIB_FILE)
258 AC_SUBST(TCL_STUB_LIB_FLAG)
259 AC_SUBST(TCL_STUB_LIB_SPEC)
260 AC_SUBST(TCL_STUB_LIB_PATH)
261 AC_SUBST(TCL_INCLUDE_SPEC)
262 AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
263 AC_SUBST(TCL_BUILD_STUB_LIB_PATH)
264 AC_SUBST(TCL_DLL_FILE)
266 AC_SUBST(TCL_SRC_DIR)
267 AC_SUBST(TCL_BIN_DIR)
269 AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
270 AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
271 AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
273 # win/tcl.m4 doesn't set (CFLAGS)
274 AC_SUBST(CFLAGS_DEFAULT)
275 AC_SUBST(EXTRA_CFLAGS)
281 # win/tcl.m4 doesn't set (LDFLAGS)
282 AC_SUBST(LDFLAGS_DEFAULT)
283 AC_SUBST(LDFLAGS_DEBUG)
284 AC_SUBST(LDFLAGS_OPTIMIZE)
285 AC_SUBST(LDFLAGS_CONSOLE)
286 AC_SUBST(LDFLAGS_WINDOW)
292 AC_SUBST(SHLIB_LD_LIBS)
293 AC_SUBST(SHLIB_CFLAGS)
294 AC_SUBST(SHLIB_SUFFIX)
295 AC_SUBST(TCL_SHARED_BUILD)
305 AC_SUBST(POST_MAKE_LIB)
309 # empty on win, but needs sub'ing
310 AC_SUBST(TCL_BUILD_LIB_SPEC)
311 AC_SUBST(TCL_LD_SEARCH_FLAGS)
312 AC_SUBST(TCL_NEEDS_EXP_FILE)
313 AC_SUBST(TCL_BUILD_EXP_FILE)
314 AC_SUBST(TCL_EXP_FILE)
316 AC_SUBST(TCL_LIB_VERSIONS_OK)
317 AC_SUBST(TCL_PACKAGE_PATH)
320 AC_SUBST(TCL_DDE_VERSION)
321 AC_SUBST(TCL_DDE_MAJOR_VERSION)
322 AC_SUBST(TCL_DDE_MINOR_VERSION)
323 AC_SUBST(TCL_DDE_PATCH_LEVEL)
324 AC_SUBST(TCL_REG_VERSION)
325 AC_SUBST(TCL_REG_MAJOR_VERSION)
326 AC_SUBST(TCL_REG_MINOR_VERSION)
327 AC_SUBST(TCL_REG_PATCH_LEVEL)
337 AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)