OSDN Git Service

* configure.in: Fix for autoconf 2.5.
[pf3gnuchains/sourceware.git] / tcl / win / configure.in
1 #! /bin/bash -norc
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.
5 #
6 # RCS: @(#) $Id$
7
8 AC_INIT(../generic/tcl.h)
9 AC_PREREQ(2.13)
10
11 TCL_VERSION=8.4
12 TCL_MAJOR_VERSION=8
13 TCL_MINOR_VERSION=4
14 TCL_PATCH_LEVEL=".1"
15 VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION
16
17 TCL_DDE_VERSION=1.2
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
22
23 TCL_REG_VERSION=1.1
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
28
29 #------------------------------------------------------------------------
30 # Handle the --prefix=... option
31 #------------------------------------------------------------------------
32
33 if test "${prefix}" = "NONE"; then
34     prefix=/usr/local
35 fi
36 if test "${exec_prefix}" = "NONE"; then
37     exec_prefix=$prefix
38 fi
39 # libdir must be a fully qualified path (not ${exec_prefix}/lib)
40 eval libdir="$libdir"
41
42 #------------------------------------------------------------------------
43 # Standard compiler checks
44 #------------------------------------------------------------------------
45
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
49     CFLAGS=""
50 fi
51
52 AC_PROG_CC
53
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, :)
63
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)
68 fi
69
70 #--------------------------------------------------------------------
71 # Checks to see if the make progeam sets the $MAKE variable.
72 #--------------------------------------------------------------------
73
74 AC_PROG_MAKE_SET
75
76 #--------------------------------------------------------------------
77 # Perform additinal compiler tests.
78 #--------------------------------------------------------------------
79
80 AC_CYGWIN
81
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.])
85 #fi
86
87
88 AC_CACHE_CHECK(for SEH support in compiler,
89     tcl_cv_seh,
90 AC_TRY_RUN([
91 #define WIN32_LEAN_AND_MEAN
92 #include <windows.h>
93 #undef WIN32_LEAN_AND_MEAN
94
95 int main(int argc, char** argv) {
96     int a, b = 0;
97     __try {
98         a = 666 / b;
99     }
100     __except (EXCEPTION_EXECUTE_HANDLER) {
101         return 0;
102     }
103     return 1;
104 }
105 ],
106         tcl_cv_seh=yes,
107         tcl_cv_seh=no,
108         tcl_cv_seh=no)
109 )
110 if test "$tcl_cv_seh" = "no" ; then
111     AC_DEFINE(HAVE_NO_SEH, 1,
112             [Defined when mingw does not support SEH])
113 fi
114
115 #
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.
120 #
121 AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files,
122     tcl_cv_eh_disposition,
123 AC_TRY_COMPILE([
124 #define WIN32_LEAN_AND_MEAN
125 #include <windows.h>
126 #undef WIN32_LEAN_AND_MEAN
127 ],
128 [
129   EXCEPTION_DISPOSITION x;
130 ],
131         tcl_cv_eh_disposition=yes,
132         tcl_cv_eh_disposition=no)
133 )
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])
137 fi
138
139 #--------------------------------------------------------------------
140 # Determines the correct binary file extension (.o, .obj, .exe etc.)
141 #--------------------------------------------------------------------
142
143 AC_OBJEXT
144 AC_EXEEXT
145
146 #--------------------------------------------------------------------
147 # Check whether --enable-threads or --disable-threads was given.
148 #--------------------------------------------------------------------
149
150 SC_ENABLE_THREADS
151
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 #--------------------------------------------------------------------
156
157 SC_ENABLE_SHARED
158
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 #--------------------------------------------------------------------
164
165 SC_CONFIG_CFLAGS
166
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 #--------------------------------------------------------------------
172
173 SC_ENABLE_SYMBOLS
174
175 TCL_DBGX=${DBGX}
176
177 #--------------------------------------------------------------------
178 # man2tcl needs this so that it can use errno.h
179 #--------------------------------------------------------------------
180
181 AC_CHECK_HEADER(errno.h, , MAN2TCLFLAGS="-DNO_ERRNO_H")
182 AC_SUBST(MAN2TCLFLAGS)
183
184 #------------------------------------------------------------------------
185 # tclConfig.sh refers to this by a different name
186 #------------------------------------------------------------------------
187
188 TCL_SHARED_BUILD=${SHARED_BUILD}
189
190 #--------------------------------------------------------------------
191 # Perform final evaluations of variables with possible substitutions.
192 #--------------------------------------------------------------------
193
194 TCL_SHARED_LIB_SUFFIX="\${NODOT_VERSION}${DLLSUFFIX}"
195 TCL_UNSHARED_LIB_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
196 TCL_EXPORT_FILE_SUFFIX="\${NODOT_VERSION}${LIBSUFFIX}"
197
198 eval "TCL_SRC_DIR=\"`cd $srcdir/..; pwd`\""
199
200 eval "TCL_DLL_FILE=tcl${VER}${DLLSUFFIX}"
201
202 eval "TCL_LIB_FILE=${LIBPREFIX}tcl$VER${LIBSUFFIX}"
203 # FIMXE: These variables decls are missing
204 #TCL_LIB_FLAG
205 TCL_BUILD_LIB_SPEC="-L`pwd` -ltcl${VER}${TCL_DBGX}"
206 #TCL_LIB_SPEC
207
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}\""
214
215 # Install time header dir can be set via --includedir
216 eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
217
218
219 eval "DLLSUFFIX=${DLLSUFFIX}"
220 eval "LIBPREFIX=${LIBPREFIX}"
221 eval "LIBSUFFIX=${LIBSUFFIX}"
222 eval "EXESUFFIX=${EXESUFFIX}"
223
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}
227
228 #--------------------------------------------------------------------
229 # Adjust the defines for how the resources are built depending
230 # on symbols and static vs. shared.
231 #--------------------------------------------------------------------
232
233 if test ${SHARED_BUILD} = 0 ; then
234     if test "${DBGX}" = "d"; then
235         RC_DEFINES="${RC_DEFINE} STATIC_BUILD ${RC_DEFINE} DEBUG"
236     else
237         RC_DEFINES="${RC_DEFINE} STATIC_BUILD"
238     fi
239 else
240     if test "${DBGX}" = "d"; then
241         RC_DEFINES="${RC_DEFINE} DEBUG"
242     else
243         RC_DEFINES=""
244     fi
245 fi
246
247
248 AC_SUBST(TCL_VERSION)
249 AC_SUBST(TCL_MAJOR_VERSION)
250 AC_SUBST(TCL_MINOR_VERSION)
251 AC_SUBST(TCL_PATCH_LEVEL)
252
253 AC_SUBST(TCL_LIB_FILE)
254 AC_SUBST(TCL_LIB_FLAG)
255 # empty on win
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)
265
266 AC_SUBST(TCL_SRC_DIR)
267 AC_SUBST(TCL_BIN_DIR)
268 AC_SUBST(TCL_DBGX)
269 AC_SUBST(CFG_TCL_SHARED_LIB_SUFFIX)
270 AC_SUBST(CFG_TCL_UNSHARED_LIB_SUFFIX)
271 AC_SUBST(CFG_TCL_EXPORT_FILE_SUFFIX)
272
273 # win/tcl.m4 doesn't set (CFLAGS)
274 AC_SUBST(CFLAGS_DEFAULT)
275 AC_SUBST(EXTRA_CFLAGS)
276 AC_SUBST(CYGPATH)
277 AC_SUBST(DEPARG)
278 AC_SUBST(CC_OBJNAME)
279 AC_SUBST(CC_EXENAME)
280
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)
287 AC_SUBST(AR)
288 AC_SUBST(RANLIB)
289
290 AC_SUBST(STLIB_LD)
291 AC_SUBST(SHLIB_LD)
292 AC_SUBST(SHLIB_LD_LIBS)
293 AC_SUBST(SHLIB_CFLAGS)
294 AC_SUBST(SHLIB_SUFFIX)
295 AC_SUBST(TCL_SHARED_BUILD)
296
297 AC_SUBST(LIBS)
298 AC_SUBST(LIBS_GUI)
299 AC_SUBST(DLLSUFFIX)
300 AC_SUBST(LIBPREFIX)
301 AC_SUBST(LIBSUFFIX)
302 AC_SUBST(EXESUFFIX)
303 AC_SUBST(LIBRARIES)
304 AC_SUBST(MAKE_LIB)
305 AC_SUBST(POST_MAKE_LIB)
306 AC_SUBST(MAKE_DLL)
307 AC_SUBST(MAKE_EXE)
308
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)
315 AC_SUBST(DL_LIBS)
316 AC_SUBST(TCL_LIB_VERSIONS_OK)
317 AC_SUBST(TCL_PACKAGE_PATH)
318
319 # win only
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)
328
329 AC_SUBST(RC)
330 AC_SUBST(RC_OUT)
331 AC_SUBST(RC_TYPE)
332 AC_SUBST(RC_INCLUDE)
333 AC_SUBST(RC_DEFINE)
334 AC_SUBST(RC_DEFINES)
335 AC_SUBST(RES)
336
337 AC_OUTPUT(Makefile tclConfig.sh tcl.hpj)