Debian Codegraph @

pTk/mTk/win/tcl.m4

raw
1 #------------------------------------------------------------------------
2 # SC_PATH_TCLCONFIG --
3 #
4 # Locate the tclConfig.sh file and perform a sanity check on
5 # the Tcl compile flags
6 # Currently a no-op for Windows
7 #
8 # Arguments:
9 # PATCH_LEVEL The patch level for Tcl if any.
10 #
11 # Results:
12 #
13 # Adds the following arguments to configure:
14 # --with-tcl=...
15 #
16 # Sets the following vars:
17 # TCL_BIN_DIR Full path to the tclConfig.sh file
18 #------------------------------------------------------------------------
19
20 AC_DEFUN(SC_PATH_TCLCONFIG, [
21 AC_MSG_CHECKING([the location of tclConfig.sh])
22
23 if test -d ../../tcl8.4$1/win; then
24 TCL_BIN_DIR_DEFAULT=../../tcl8.4$1/win
25 elif test -d ../../tcl8.4/win; then
26 TCL_BIN_DIR_DEFAULT=../../tcl8.4/win
27 else
28 TCL_BIN_DIR_DEFAULT=../../tcl/win
29 fi
30
31 AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR],
32 TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DIR_DEFAULT; pwd`)
33 if test ! -d $TCL_BIN_DIR; then
34 AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
35 fi
36 if test ! -f $TCL_BIN_DIR/tclConfig.sh; then
37 AC_MSG_ERROR(There is no tclConfig.sh in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
38 fi
39 AC_MSG_RESULT($TCL_BIN_DIR/tclConfig.sh)
40 ])
41
42 #------------------------------------------------------------------------
43 # SC_PATH_TKCONFIG --
44 #
45 # Locate the tkConfig.sh file
46 # Currently a no-op for Windows
47 #
48 # Arguments:
49 # none
50 #
51 # Results:
52 #
53 # Adds the following arguments to configure:
54 # --with-tk=...
55 #
56 # Sets the following vars:
57 # TK_BIN_DIR Full path to the tkConfig.sh file
58 #------------------------------------------------------------------------
59
60 AC_DEFUN(SC_PATH_TKCONFIG, [
61 AC_MSG_CHECKING([the location of tkConfig.sh])
62
63 if test -d ../../tk8.4$1/win; then
64 TK_BIN_DIR_DEFAULT=../../tk8.4$1/win
65 elif test -d ../../tk8.4/win; then
66 TK_BIN_DIR_DEFAULT=../../tk8.4/win
67 else
68 TK_BIN_DIR_DEFAULT=../../tk/win
69 fi
70
71 AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.4 binaries from DIR],
72 TK_BIN_DIR=$withval, TK_BIN_DIR=`cd $TK_BIN_DIR_DEFAULT; pwd`)
73 if test ! -d $TK_BIN_DIR; then
74 AC_MSG_ERROR(Tk directory $TK_BIN_DIR does not exist)
75 fi
76 if test ! -f $TK_BIN_DIR/tkConfig.sh; then
77 AC_MSG_ERROR(There is no tkConfig.sh in $TK_BIN_DIR: perhaps you did not specify the Tk *build* directory (not the toplevel Tk directory) or you forgot to configure Tk?)
78 fi
79
80 AC_MSG_RESULT([$TK_BIN_DIR/tkConfig.sh])
81 ])
82
83 #------------------------------------------------------------------------
84 # SC_LOAD_TCLCONFIG --
85 #
86 # Load the tclConfig.sh file.
87 #
88 # Arguments:
89 #
90 # Requires the following vars to be set:
91 # TCL_BIN_DIR
92 #
93 # Results:
94 #
95 # Subst the following vars:
96 # TCL_BIN_DIR
97 # TCL_SRC_DIR
98 # TCL_LIB_FILE
99 #
100 #------------------------------------------------------------------------
101
102 AC_DEFUN(SC_LOAD_TCLCONFIG, [
103 AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh])
104
105 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
106 AC_MSG_RESULT([loading])
107 . $TCL_BIN_DIR/tclConfig.sh
108 else
109 AC_MSG_RESULT([file not found])
110 fi
111
112 #
113 # If the TCL_BIN_DIR is the build directory (not the install directory),
114 # then set the common variable name to the value of the build variables.
115 # For example, the variable TCL_LIB_SPEC will be set to the value
116 # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
117 # instead of TCL_BUILD_LIB_SPEC since it will work with both an
118 # installed and uninstalled version of Tcl.
119 #
120
121 if test -f $TCL_BIN_DIR/Makefile ; then
122 TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC}
123 TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC}
124 TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH}
125 fi
126
127 #
128 # eval is required to do the TCL_DBGX substitution
129 #
130
131 eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
132 eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
133 eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
134
135 eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
136 eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
137 eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
138
139 AC_SUBST(TCL_VERSION)
140 AC_SUBST(TCL_BIN_DIR)
141 AC_SUBST(TCL_SRC_DIR)
142
143 AC_SUBST(TCL_LIB_FILE)
144 AC_SUBST(TCL_LIB_FLAG)
145 AC_SUBST(TCL_LIB_SPEC)
146
147 AC_SUBST(TCL_STUB_LIB_FILE)
148 AC_SUBST(TCL_STUB_LIB_FLAG)
149 AC_SUBST(TCL_STUB_LIB_SPEC)
150
151 AC_SUBST(TCL_DEFS)
152 ])
153
154 #------------------------------------------------------------------------
155 # SC_LOAD_TKCONFIG --
156 #
157 # Load the tkConfig.sh file
158 # Currently a no-op for Windows
159 #
160 # Arguments:
161 #
162 # Requires the following vars to be set:
163 # TK_BIN_DIR
164 #
165 # Results:
166 #
167 # Sets the following vars that should be in tkConfig.sh:
168 # TK_BIN_DIR
169 #------------------------------------------------------------------------
170
171 AC_DEFUN(SC_LOAD_TKCONFIG, [
172 AC_MSG_CHECKING([for existence of $TK_BIN_DIR/tkConfig.sh])
173
174 if test -f "$TK_BIN_DIR/tkConfig.sh" ; then
175 AC_MSG_RESULT([loading])
176 . $TK_BIN_DIR/tkConfig.sh
177 else
178 AC_MSG_RESULT([could not find $TK_BIN_DIR/tkConfig.sh])
179 fi
180
181
182 AC_SUBST(TK_BIN_DIR)
183 AC_SUBST(TK_SRC_DIR)
184 AC_SUBST(TK_LIB_FILE)
185 ])
186
187 #------------------------------------------------------------------------
188 # SC_ENABLE_SHARED --
189 #
190 # Allows the building of shared libraries
191 #
192 # Arguments:
193 # none
194 #
195 # Results:
196 #
197 # Adds the following arguments to configure:
198 # --enable-shared=yes|no
199 #
200 # Defines the following vars:
201 # STATIC_BUILD Used for building import/export libraries
202 # on Windows.
203 #
204 # Sets the following vars:
205 # SHARED_BUILD Value of 1 or 0
206 #------------------------------------------------------------------------
207
208 AC_DEFUN(SC_ENABLE_SHARED, [
209 AC_MSG_CHECKING([how to build libraries])
210 AC_ARG_ENABLE(shared,
211 [ --enable-shared build and link with shared libraries [--enable-shared]],
212 [tcl_ok=$enableval], [tcl_ok=yes])
213
214 if test "${enable_shared+set}" = set; then
215 enableval="$enable_shared"
216 tcl_ok=$enableval
217 else
218 tcl_ok=yes
219 fi
220
221 if test "$tcl_ok" = "yes" ; then
222 AC_MSG_RESULT([shared])
223 SHARED_BUILD=1
224 else
225 AC_MSG_RESULT([static])
226 SHARED_BUILD=0
227 AC_DEFINE(STATIC_BUILD)
228 fi
229 ])
230
231 #------------------------------------------------------------------------
232 # SC_ENABLE_THREADS --
233 #
234 # Specify if thread support should be enabled
235 #
236 # Arguments:
237 # none
238 #
239 # Results:
240 #
241 # Adds the following arguments to configure:
242 # --enable-threads=yes|no
243 #
244 # Defines the following vars:
245 # TCL_THREADS
246 #------------------------------------------------------------------------
247
248 AC_DEFUN(SC_ENABLE_THREADS, [
249 AC_MSG_CHECKING(for building with threads)
250 AC_ARG_ENABLE(threads, [ --enable-threads build with threads],
251 [tcl_ok=$enableval], [tcl_ok=no])
252
253 if test "$tcl_ok" = "yes"; then
254 AC_MSG_RESULT(yes)
255 TCL_THREADS=1
256 AC_DEFINE(TCL_THREADS)
257 # USE_THREAD_ALLOC tells us to try the special thread-based
258 # allocator that significantly reduces lock contention
259 AC_DEFINE(USE_THREAD_ALLOC)
260 else
261 TCL_THREADS=0
262 AC_MSG_RESULT([no (default)])
263 fi
264 AC_SUBST(TCL_THREADS)
265 ])
266
267 #------------------------------------------------------------------------
268 # SC_ENABLE_SYMBOLS --
269 #
270 # Specify if debugging symbols should be used
271 # Memory (TCL_MEM_DEBUG) and compile (TCL_COMPILE_DEBUG) debugging
272 # can also be enabled.
273 #
274 # Arguments:
275 # none
276 #
277 # Requires the following vars to be set in the Makefile:
278 # CFLAGS_DEBUG
279 # CFLAGS_OPTIMIZE
280 #
281 # Results:
282 #
283 # Adds the following arguments to configure:
284 # --enable-symbols
285 #
286 # Defines the following vars:
287 # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true
288 # Sets to $(CFLAGS_OPTIMIZE) if false
289 # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
290 # Sets to $(LDFLAGS_OPTIMIZE) if false
291 # DBGX Debug library extension
292 #
293 #------------------------------------------------------------------------
294
295 AC_DEFUN(SC_ENABLE_SYMBOLS, [
296 AC_MSG_CHECKING([for build with symbols])
297 AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no])
298 # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
299 if test "$tcl_ok" = "no"; then
300 CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
301 LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
302 DBGX=""
303 AC_MSG_RESULT([no])
304 else
305 CFLAGS_DEFAULT='$(CFLAGS_DEBUG)'
306 LDFLAGS_DEFAULT='$(LDFLAGS_DEBUG)'
307 DBGX=g
308 if test "$tcl_ok" = "yes"; then
309 AC_MSG_RESULT([yes (standard debugging)])
310 fi
311 fi
312 AC_SUBST(CFLAGS_DEFAULT)
313 AC_SUBST(LDFLAGS_DEFAULT)
314
315 if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then
316 AC_DEFINE(TCL_MEM_DEBUG)
317 fi
318
319 if test "$tcl_ok" = "compile" -o "$tcl_ok" = "all"; then
320 AC_DEFINE(TCL_COMPILE_DEBUG)
321 AC_DEFINE(TCL_COMPILE_STATS)
322 fi
323
324 if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then
325 if test "$tcl_ok" = "all"; then
326 AC_MSG_RESULT([enabled symbols mem compile debugging])
327 else
328 AC_MSG_RESULT([enabled $tcl_ok debugging])
329 fi
330 fi
331 ])
332
333 #--------------------------------------------------------------------
334 # SC_CONFIG_CFLAGS
335 #
336 # Try to determine the proper flags to pass to the compiler
337 # for building shared libraries and other such nonsense.
338 #
339 # NOTE: The backslashes in quotes below are substituted twice
340 # due to the fact that they are in a macro and then inlined
341 # in the final configure script.
342 #
343 # Arguments:
344 # none
345 #
346 # Results:
347 #
348 # Can the following vars:
349 # EXTRA_CFLAGS
350 # CFLAGS_DEBUG
351 # CFLAGS_OPTIMIZE
352 # CFLAGS_WARNING
353 # LDFLAGS_DEBUG
354 # LDFLAGS_OPTIMIZE
355 # LDFLAGS_CONSOLE
356 # LDFLAGS_WINDOW
357 # CC_OBJNAME
358 # CC_EXENAME
359 # CYGPATH
360 # STLIB_LD
361 # SHLIB_LD
362 # SHLIB_LD_LIBS
363 # LIBS
364 # AR
365 # RC
366 # RES
367 #
368 # MAKE_LIB
369 # MAKE_EXE
370 # MAKE_DLL
371 #
372 # LIBSUFFIX
373 # LIBPREFIX
374 # LIBRARIES
375 # EXESUFFIX
376 # DLLSUFFIX
377 #
378 #--------------------------------------------------------------------
379
380 AC_DEFUN(SC_CONFIG_CFLAGS, [
381
382 # Step 0: Enable 64 bit support?
383
384 AC_MSG_CHECKING([if 64bit support is requested])
385 AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no])
386 AC_MSG_RESULT($do64bit)
387
388 # Set some defaults (may get changed below)
389 EXTRA_CFLAGS=""
390
391 AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo)
392
393 SHLIB_SUFFIX=".dll"
394
395 # Check for a bug in gcc's windres that causes the
396 # compile to fail when a Windows native path is
397 # passed into windres. The mingw toolchain requires
398 # Windows native paths while Cygwin should work
399 # with both. Avoid the bug by passing a POSIX
400 # path when using the Cygwin toolchain.
401
402 if test "$GCC" = "yes" && test "$CYGPATH" != "echo" ; then
403 conftest=/tmp/conftest.rc
404 echo "STRINGTABLE BEGIN" > $conftest
405 echo "101 \"name\"" >> $conftest
406 echo "END" >> $conftest
407
408 AC_MSG_CHECKING([for Windows native path bug in windres])
409 cyg_conftest=`$CYGPATH $conftest`
410 if AC_TRY_COMMAND($RC -o conftest.res.o $cyg_conftest) ; then
411 AC_MSG_RESULT([no])
412 else
413 AC_MSG_RESULT([yes])
414 CYGPATH=echo
415 fi
416 conftest=
417 cyg_conftest=
418 fi
419
420 if test "$CYGPATH" = "echo" || test "$ac_cv_cygwin" = "yes"; then
421 DEPARG='"$<"'
422 else
423 DEPARG='"$(shell $(CYGPATH) $<)"'
424 fi
425
426 # set various compiler flags depending on whether we are using gcc or cl
427
428 AC_MSG_CHECKING([compiler flags])
429 if test "${GCC}" = "yes" ; then
430 if test "$do64bit" = "yes" ; then
431 AC_MSG_WARN("64bit mode not supported with GCC on Windows")
432 fi
433 SHLIB_LD=""
434 SHLIB_LD_LIBS=""
435 LIBS=""
436 LIBS_GUI="-lgdi32 -lcomdlg32 -limm32 -lcomctl32 -lshell32"
437 STLIB_LD='${AR} cr'
438 RC_OUT=-o
439 RC_TYPE=
440 RC_INCLUDE=--include
441 RC_DEFINE=--define
442 RES=res.o
443 MAKE_LIB="\${STLIB_LD} \[$]@"
444 POST_MAKE_LIB="\${RANLIB} \[$]@"
445 MAKE_EXE="\${CC} -o \[$]@"
446 LIBPREFIX="lib"
447
448 #if test "$ac_cv_cygwin" = "yes"; then
449 # extra_cflags="-mno-cygwin"
450 # extra_ldflags="-mno-cygwin"
451 #else
452 # extra_cflags=""
453 # extra_ldflags=""
454 #fi
455
456 if test "$ac_cv_cygwin" = "yes"; then
457 touch ac$$.c
458 if ${CC} -c -mwin32 ac$$.c >/dev/null 2>&1; then
459 case "$extra_cflags" in
460 *-mwin32*) ;;
461 *) extra_cflags="-mwin32 $extra_cflags" ;;
462 esac
463 case "$extra_ldflags" in
464 *-mwin32*) ;;
465 *) extra_ldflags="-mwin32 $extra_ldflags" ;;
466 esac
467 fi
468 rm -f ac$$.o ac$$.c
469 else
470 extra_cflags=''
471 extra_ldflags=''
472 fi
473
474 if test "${SHARED_BUILD}" = "0" ; then
475 # static
476 AC_MSG_RESULT([using static flags])
477 runtime=
478 MAKE_DLL="echo "
479 LIBSUFFIX="s\${DBGX}.a"
480 LIBFLAGSUFFIX="s\${DBGX}"
481 LIBRARIES="\${STATIC_LIBRARIES}"
482 EXESUFFIX="s\${DBGX}.exe"
483 else
484 # dynamic
485 AC_MSG_RESULT([using shared flags])
486
487 # ad-hoc check to see if CC supports -shared.
488 if "${CC}" -shared 2>&1 | egrep ': -shared not supported' >/dev/null; then
489 AC_MSG_ERROR([${CC} does not support the -shared option.
490 You will need to upgrade to a newer version of the toolchain.])
491 fi
492
493 runtime=
494 # Link with gcc since ld does not link to default libs like
495 # -luser32 and -lmsvcrt by default. Make sure CFLAGS is
496 # included so -mno-cygwin passed the correct libs to the linker.
497 SHLIB_LD='${CC} -shared ${CFLAGS}'
498 SHLIB_LD_LIBS='${LIBS}'
499 # Add SHLIB_LD_LIBS to the Make rule, not here.
500 MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -o \[$]@ ${extra_ldflags} \
501 -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\[$]@)"
502
503 LIBSUFFIX="\${DBGX}.a"
504 LIBFLAGSUFFIX="\${DBGX}"
505 EXESUFFIX="\${DBGX}.exe"
506 LIBRARIES="\${SHARED_LIBRARIES}"
507 fi
508 # DLLSUFFIX is separate because it is the building block for
509 # users of tclConfig.sh that may build shared or static.
510 DLLSUFFIX="\${DBGX}.dll"
511 SHLIB_SUFFIX=.dll
512
513 EXTRA_CFLAGS="${extra_cflags}"
514
515 CFLAGS_DEBUG=-g
516 CFLAGS_OPTIMIZE=-O
517 CFLAGS_WARNING="-Wall -Wconversion"
518 LDFLAGS_DEBUG=
519 LDFLAGS_OPTIMIZE=
520
521 # Specify the CC output file names based on the target name
522 CC_OBJNAME="-o \[$]@"
523 CC_EXENAME="-o \[$]@"
524
525 # Specify linker flags depending on the type of app being
526 # built -- Console vs. Window.
527 #
528 # ORIGINAL COMMENT:
529 # We need to pass -e _WinMain@16 so that ld will use
530 # WinMain() instead of main() as the entry point. We can't
531 # use autoconf to check for this case since it would need
532 # to run an executable and that does not work when
533 # cross compiling. Remove this -e workaround once we
534 # require a gcc that does not have this bug.
535 #
536 # MK NOTE: Tk should use a different mechanism. This causes
537 # interesting problems, such as wish dying at startup.
538 #LDFLAGS_WINDOW="-mwindows -e _WinMain@16 ${extra_ldflags}"
539 LDFLAGS_CONSOLE="-mconsole ${extra_ldflags}"
540 LDFLAGS_WINDOW="-mwindows ${extra_ldflags}"
541 else
542 if test "${SHARED_BUILD}" = "0" ; then
543 # static
544 AC_MSG_RESULT([using static flags])
545 runtime=-MT
546 MAKE_DLL="echo "
547 LIBSUFFIX="s\${DBGX}.lib"
548 LIBFLAGSUFFIX="s\${DBGX}"
549 LIBRARIES="\${STATIC_LIBRARIES}"
550 EXESUFFIX="s\${DBGX}.exe"
551 SHLIB_LD_LIBS=""
552 else
553 # dynamic
554 AC_MSG_RESULT([using shared flags])
555 runtime=-MD
556 # Add SHLIB_LD_LIBS to the Make rule, not here.
557 MAKE_DLL="\${SHLIB_LD} \$(LDFLAGS) -out:\[$]@"
558 LIBSUFFIX="\${DBGX}.lib"
559 LIBFLAGSUFFIX="\${DBGX}"
560 EXESUFFIX="\${DBGX}.exe"
561 LIBRARIES="\${SHARED_LIBRARIES}"
562 SHLIB_LD_LIBS='${LIBS}'
563 fi
564 # DLLSUFFIX is separate because it is the building block for
565 # users of tclConfig.sh that may build shared or static.
566 DLLSUFFIX="\${DBGX}.dll"
567
568 # This is a 2-stage check to make sure we have the 64-bit SDK
569 # We have to know where the SDK is installed.
570 if test "$do64bit" = "yes" ; then
571 if test "x${MSSDK}x" = "xx" ; then
572 MSSDK="C:/Progra~1/Microsoft SDK"
573 fi
574 # In order to work in the tortured autoconf environment,
575 # we need to ensure that this path has no spaces
576 MSSDK=$(cygpath -w -s "$MSSDK" | sed -e 's!\\!/!g')
577 if test ! -d "${MSSDK}/bin/win64" ; then
578 AC_MSG_WARN("could not find 64-bit SDK to enable 64bit mode")
579 do64bit="no"
580 fi
581 fi
582
583 if test "$do64bit" = "yes" ; then
584 # All this magic is necessary for the Win64 SDK RC1 - hobbs
585 CC="${MSSDK}/Bin/Win64/cl.exe \
586 -I${MSSDK}/Include/prerelease \
587 -I${MSSDK}/Include/Win64/crt \
588 -I${MSSDK}/Include/Win64/crt/sys \
589 -I${MSSDK}/Include"
590 RC="${MSSDK}/bin/rc.exe"
591 CFLAGS_DEBUG="-nologo -Zi -Od ${runtime}d"
592 CFLAGS_OPTIMIZE="-nologo -O2 -Gs ${runtime}"
593 lflags="-MACHINE:IA64 -LIBPATH:${MSSDK}/Lib/IA64 \
594 -LIBPATH:${MSSDK}/Lib/Prerelease/IA64"
595 STLIB_LD="${MSSDK}/bin/win64/lib.exe -nologo ${lflags}"
596 LINKBIN="${MSSDK}/bin/win64/link.exe ${lflags}"
597 else
598 RC="rc"
599 CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
600 CFLAGS_OPTIMIZE="-nologo -Oti -Gs -GD ${runtime}"
601 STLIB_LD="lib -nologo"
602 LINKBIN="link -link50compat"
603 fi
604
605 SHLIB_LD="${LINKBIN} -dll -nologo -incremental:no"
606 LIBS="user32.lib advapi32.lib"
607 LIBS_GUI="gdi32.lib comdlg32.lib imm32.lib comctl32.lib shell32.lib"
608 RC_OUT=-fo
609 RC_TYPE=-r
610 RC_INCLUDE=-i
611 RC_DEFINE=-d
612 RES=res
613 MAKE_LIB="\${STLIB_LD} -out:\[$]@"
614 POST_MAKE_LIB=
615 MAKE_EXE="\${CC} -Fe\[$]@"
616 LIBPREFIX=""
617
618 EXTRA_CFLAGS="-YX"
619 CFLAGS_WARNING="-W3"
620 LDFLAGS_DEBUG="-debug:full -debugtype:both"
621 LDFLAGS_OPTIMIZE="-release"
622
623 # Specify the CC output file names based on the target name
624 CC_OBJNAME="-Fo\[$]@"
625 CC_EXENAME="-Fe\"\$(shell \$(CYGPATH) '\[$]@')\""
626
627 # Specify linker flags depending on the type of app being
628 # built -- Console vs. Window.
629 LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}"
630 LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}"
631 fi
632
633 # DL_LIBS is empty, but then we match the Unix version
634 AC_SUBST(DL_LIBS)
635 AC_SUBST(CFLAGS_DEBUG)
636 AC_SUBST(CFLAGS_OPTIMIZE)
637 AC_SUBST(CFLAGS_WARNING)
638 ])
639
640 #------------------------------------------------------------------------
641 # SC_WITH_TCL --
642 #
643 # Location of the Tcl build directory.
644 #
645 # Arguments:
646 # none
647 #
648 # Results:
649 #
650 # Adds the following arguments to configure:
651 # --with-tcl=...
652 #
653 # Defines the following vars:
654 # TCL_BIN_DIR Full path to the tcl build dir.
655 #------------------------------------------------------------------------
656
657 AC_DEFUN(SC_WITH_TCL, [
658 if test -d ../../tcl8.4$1/win; then
659 TCL_BIN_DEFAULT=../../tcl8.4$1/win
660 else
661 TCL_BIN_DEFAULT=../../tcl8.4/win
662 fi
663
664 AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.4 binaries from DIR],
665 TCL_BIN_DIR=$withval, TCL_BIN_DIR=`cd $TCL_BIN_DEFAULT; pwd`)
666 if test ! -d $TCL_BIN_DIR; then
667 AC_MSG_ERROR(Tcl directory $TCL_BIN_DIR does not exist)
668 fi
669 if test ! -f $TCL_BIN_DIR/Makefile; then
670 AC_MSG_ERROR(There is no Makefile in $TCL_BIN_DIR: perhaps you did not specify the Tcl *build* directory (not the toplevel Tcl directory) or you forgot to configure Tcl?)
671 else
672 echo "building against Tcl binaries in: $TCL_BIN_DIR"
673 fi
674 AC_SUBST(TCL_BIN_DIR)
675 ])
676
677 # FIXME : SC_PROG_TCLSH should really look for the installed tclsh and
678 # not the build version. If we want to use the build version in the
679 # tk script, it is better to hardcode that!
680
681 #------------------------------------------------------------------------
682 # SC_PROG_TCLSH
683 # Locate a tclsh shell in the following directories:
684 # ${exec_prefix}/bin
685 # ${prefix}/bin
686 # ${TCL_BIN_DIR}
687 # ${TCL_BIN_DIR}/../bin
688 # ${PATH}
689 #
690 # Arguments
691 # none
692 #
693 # Results
694 # Subst's the following values:
695 # TCLSH_PROG
696 #------------------------------------------------------------------------
697
698 AC_DEFUN(SC_PROG_TCLSH, [
699 AC_MSG_CHECKING([for tclsh])
700
701 AC_CACHE_VAL(ac_cv_path_tclsh, [
702 search_path=`echo ${exec_prefix}/bin:${prefix}/bin:${TCL_BIN_DIR}:${TCL_BIN_DIR}/../bin:${PATH} | sed -e 's/:/ /g'`
703 for dir in $search_path ; do
704 for j in `ls -r $dir/tclsh[[8-9]]*.exe 2> /dev/null` \
705 `ls -r $dir/tclsh* 2> /dev/null` ; do
706 if test x"$ac_cv_path_tclsh" = x ; then
707 if test -f "$j" ; then
708 ac_cv_path_tclsh=$j
709 break
710 fi
711 fi
712 done
713 done
714 ])
715
716 if test -f "$ac_cv_path_tclsh" ; then
717 TCLSH_PROG="$ac_cv_path_tclsh"
718 AC_MSG_RESULT($TCLSH_PROG)
719 elif test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
720 # One-tree build.
721 ac_cv_path_tclsh="$TCL_BIN_DIR/tclsh"
722 TCLSH_PROG="$ac_cv_path_tclsh"
723 AC_MSG_RESULT($TCLSH_PROG)
724 else
725 AC_MSG_ERROR(No tclsh found in PATH: $search_path)
726 fi
727 AC_SUBST(TCLSH_PROG)
728 ])