New upstream version 4.2.1
Sergei Golovan
3 years ago
142 | 142 | |
143 | 143 | TESTLOADARG = if {[catch {package present ${PACKAGE_NAME}}]} {package forget ${PACKAGE_NAME}}; \ |
144 | 144 | package ifneeded ${PACKAGE_NAME} ${PACKAGE_VERSION} \ |
145 | [list load `@CYGPATH@ $(top_builddir)/$(PKG_LIB_FILE)` $(PACKAGE_NAME)] | |
145 | [list load `@CYGPATH@ $(top_builddir)/$(PKG_LIB_FILE)` [string totitle $(PACKAGE_NAME)]] | |
146 | 146 | |
147 | 147 | #WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` |
148 | 148 | #WISH_PROG = @WISH_PROG@ |
162 | 162 | # you do not compile with a similar machine setup as the Tcl core was |
163 | 163 | # compiled with. |
164 | 164 | #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) |
165 | DEFS = @DEFS@ $(PKG_CFLAGS) -DITCL_LIBRARY=\"$(pkglibdir)\" | |
165 | DEFS = @DEFS@ $(PKG_CFLAGS) -DITCL_LIBRARY="$(pkglibdir)" | |
166 | 166 | |
167 | 167 | # Move pkgIndex.tcl to 'BINARIES' var if it is generated in the Makefile |
168 | 168 | CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ Makefile itclConfig.sh pkgIndex.tcl |
224 | 224 | #======================================================================== |
225 | 225 | |
226 | 226 | install-libraries: libraries |
227 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(includedir) | |
227 | @$(INSTALL_DATA_DIR) "$(DESTDIR)$(includedir)" | |
228 | 228 | @echo "Installing header files in $(DESTDIR)$(includedir)" |
229 | 229 | @list='$(PKG_HEADERS)'; for i in $$list; do \ |
230 | 230 | echo "Installing $(srcdir)/$$i" ; \ |
231 | $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \ | |
231 | $(INSTALL_DATA) $(srcdir)/$$i "$(DESTDIR)$(includedir)" ; \ | |
232 | 232 | done; |
233 | 233 | |
234 | 234 | #======================================================================== |
237 | 237 | #======================================================================== |
238 | 238 | |
239 | 239 | install-doc: doc |
240 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(mandir)/mann | |
240 | @$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/mann" | |
241 | 241 | @echo "Installing documentation in $(DESTDIR)$(mandir)" |
242 | 242 | @list='$(srcdir)/doc/*.n'; for i in $$list; do \ |
243 | 243 | if test X"$$i" = X'$(srcdir)/doc/*.n'; then break; fi; \ |
244 | 244 | bi=`basename $$i`; \ |
245 | 245 | echo "Installing $$bi"; \ |
246 | 246 | sed -e '/man\.macros/r $(srcdir)/doc/man.macros' -e '/man\.macros/d' $$i > $$bi.tmp \ |
247 | && $(INSTALL_DATA) $$bi.tmp $(DESTDIR)$(mandir)/mann/$$bi \ | |
247 | && $(INSTALL_DATA) $$bi.tmp "$(DESTDIR)$(mandir)/mann/$$bi" \ | |
248 | 248 | && rm -f $$bi.tmp; \ |
249 | 249 | done |
250 | 250 | |
400 | 400 | #======================================================================== |
401 | 401 | |
402 | 402 | install-lib-binaries: binaries |
403 | @$(INSTALL_DATA_DIR) $(DESTDIR)$(pkglibdir) | |
403 | @$(INSTALL_DATA_DIR) "$(DESTDIR)$(pkglibdir)" | |
404 | 404 | @list='$(lib_BINARIES)'; for p in $$list; do \ |
405 | 405 | if test -f $$p; then \ |
406 | 406 | echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \ |
407 | $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p; \ | |
407 | $(INSTALL_LIBRARY) $$p "$(DESTDIR)$(pkglibdir)/$$p"; \ | |
408 | 408 | ext=`echo $$p|sed -e "s/.*\.//"`; \ |
409 | 409 | if test "x$$ext" = "xdll"; then \ |
410 | 410 | lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ |
411 | 411 | if test -f $$lib; then \ |
412 | 412 | echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \ |
413 | $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib; \ | |
413 | $(INSTALL_DATA) $$lib "$(DESTDIR)$(pkglibdir)/$$lib"; \ | |
414 | 414 | fi; \ |
415 | 415 | fi; \ |
416 | 416 | fi; \ |
419 | 419 | if test -f $(srcdir)/$$p; then \ |
420 | 420 | destp=`basename $$p`; \ |
421 | 421 | echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ |
422 | $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ | |
422 | $(INSTALL_DATA) $(srcdir)/$$p "$(DESTDIR)$(pkglibdir)/$$destp"; \ | |
423 | 423 | fi; \ |
424 | 424 | done |
425 | 425 | @if test "x$(SHARED_BUILD)" = "x1"; then \ |
426 | 426 | echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ |
427 | $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ | |
427 | $(INSTALL_DATA) pkgIndex.tcl "$(DESTDIR)$(pkglibdir)"; \ | |
428 | 428 | fi |
429 | $(INSTALL_DATA) itclConfig.sh $(DESTDIR)$(pkglibdir) | |
429 | $(INSTALL_DATA) itclConfig.sh "$(DESTDIR)$(pkglibdir)" | |
430 | 430 | |
431 | 431 | #======================================================================== |
432 | 432 | # Install binary executables (e.g. .exe files and dependent .dll files) |
442 | 442 | @list='$(bin_BINARIES)'; for p in $$list; do \ |
443 | 443 | if test -f $$p; then \ |
444 | 444 | echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ |
445 | $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ | |
445 | $(INSTALL_PROGRAM) $$p "$(DESTDIR)$(bindir)/$$p"; \ | |
446 | 446 | fi; \ |
447 | 447 | done |
448 | 448 | |
452 | 452 | |
453 | 453 | uninstall-binaries: |
454 | 454 | list='$(lib_BINARIES)'; for p in $$list; do \ |
455 | rm -f $(DESTDIR)$(pkglibdir)/$$p; \ | |
455 | rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ | |
456 | 456 | done |
457 | 457 | list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ |
458 | 458 | p=`basename $$p`; \ |
459 | rm -f $(DESTDIR)$(pkglibdir)/$$p; \ | |
459 | rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \ | |
460 | 460 | done |
461 | 461 | list='$(bin_BINARIES)'; for p in $$list; do \ |
462 | rm -f $(DESTDIR)$(bindir)/$$p; \ | |
462 | rm -f "$(DESTDIR)$(bindir)/$$p"; \ | |
463 | 463 | done |
464 | 464 | |
465 | 465 | .PHONY: all binaries clean depend distclean doc install libraries test |
0 | 0 | README: Itcl |
1 | 1 | |
2 | This is the 4.2.0 source distribution of Itcl, an object oriented | |
2 | This is the 4.2.1 source distribution of Itcl, an object oriented | |
3 | 3 | extension for Tcl. Itcl releases are available from Sourceforge at: |
4 | 4 | |
5 | 5 | https://sourceforge.net/projects/incrtcl/files/%5Bincr%20Tcl_Tk%5D-4-source/ |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for itcl 4.2.0. | |
2 | # Generated by GNU Autoconf 2.69 for itcl 4.2.1. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
576 | 576 | # Identity of this package. |
577 | 577 | PACKAGE_NAME='itcl' |
578 | 578 | PACKAGE_TARNAME='itcl' |
579 | PACKAGE_VERSION='4.2.0' | |
580 | PACKAGE_STRING='itcl 4.2.0' | |
579 | PACKAGE_VERSION='4.2.1' | |
580 | PACKAGE_STRING='itcl 4.2.1' | |
581 | 581 | PACKAGE_BUGREPORT='' |
582 | 582 | PACKAGE_URL='' |
583 | 583 | |
637 | 637 | MAKE_STATIC_LIB |
638 | 638 | MAKE_SHARED_LIB |
639 | 639 | MAKE_LIB |
640 | TCL_DBGX | |
641 | 640 | LDFLAGS_DEFAULT |
642 | 641 | CFLAGS_DEFAULT |
643 | 642 | LD_LIBRARY_PATH_VAR |
645 | 644 | SHLIB_LD_LIBS |
646 | 645 | SHLIB_LD |
647 | 646 | STLIB_LD |
647 | LDFLAGS_OPTIMIZE | |
648 | LDFLAGS_DEBUG | |
648 | 649 | CFLAGS_WARNING |
649 | 650 | CFLAGS_OPTIMIZE |
650 | 651 | CFLAGS_DEBUG |
1304 | 1305 | # Omit some internal or obsolete options to make the list less imposing. |
1305 | 1306 | # This message is too long to be a string in the A/UX 3.1 sh. |
1306 | 1307 | cat <<_ACEOF |
1307 | \`configure' configures itcl 4.2.0 to adapt to many kinds of systems. | |
1308 | \`configure' configures itcl 4.2.1 to adapt to many kinds of systems. | |
1308 | 1309 | |
1309 | 1310 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1310 | 1311 | |
1365 | 1366 | |
1366 | 1367 | if test -n "$ac_init_help"; then |
1367 | 1368 | case $ac_init_help in |
1368 | short | recursive ) echo "Configuration of itcl 4.2.0:";; | |
1369 | short | recursive ) echo "Configuration of itcl 4.2.1:";; | |
1369 | 1370 | esac |
1370 | 1371 | cat <<\_ACEOF |
1371 | 1372 | |
1465 | 1466 | test -n "$ac_init_help" && exit $ac_status |
1466 | 1467 | if $ac_init_version; then |
1467 | 1468 | cat <<\_ACEOF |
1468 | itcl configure 4.2.0 | |
1469 | itcl configure 4.2.1 | |
1469 | 1470 | generated by GNU Autoconf 2.69 |
1470 | 1471 | |
1471 | 1472 | Copyright (C) 2012 Free Software Foundation, Inc. |
1884 | 1885 | This file contains any messages produced by compilers while |
1885 | 1886 | running configure, to aid debugging if configure makes a mistake. |
1886 | 1887 | |
1887 | It was created by itcl $as_me 4.2.0, which was | |
1888 | It was created by itcl $as_me 4.2.1, which was | |
1888 | 1889 | generated by GNU Autoconf 2.69. Invocation command line was |
1889 | 1890 | |
1890 | 1891 | $ $0 $@ |
3425 | 3426 | $as_echo "could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6; } |
3426 | 3427 | fi |
3427 | 3428 | |
3428 | # eval is required to do the TCL_DBGX substitution | |
3429 | eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" | |
3430 | eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" | |
3431 | ||
3432 | 3429 | # If the TCL_BIN_DIR is the build directory (not the install directory), |
3433 | 3430 | # then set the common variable name to the value of the build variables. |
3434 | 3431 | # For example, the variable TCL_LIB_SPEC will be set to the value |
3461 | 3458 | ;; |
3462 | 3459 | esac |
3463 | 3460 | fi |
3464 | ||
3465 | # eval is required to do the TCL_DBGX substitution | |
3466 | eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" | |
3467 | eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" | |
3468 | eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" | |
3469 | eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" | |
3470 | 3461 | |
3471 | 3462 | |
3472 | 3463 | |
5086 | 5077 | for i in $vars; do |
5087 | 5078 | if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then |
5088 | 5079 | # Convert foo.lib to -lfoo for GCC. No-op if not *.lib |
5089 | i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` | |
5080 | i=`echo "$i" | sed -e 's/^\([^-].*\)\.[lL][iI][bB]$/-l\1/'` | |
5090 | 5081 | fi |
5091 | 5082 | PKG_LIBS="$PKG_LIBS $i" |
5092 | 5083 | done |
6100 | 6091 | case $system in |
6101 | 6092 | # TEA specific: |
6102 | 6093 | windows) |
6103 | # This is a 2-stage check to make sure we have the 64-bit SDK | |
6104 | # We have to know where the SDK is installed. | |
6105 | # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs | |
6106 | # MACHINE is IX86 for LINK, but this is used by the manifest, | |
6107 | # which requires x86|amd64|ia64. | |
6108 | 6094 | MACHINE="X86" |
6109 | 6095 | if test "$do64bit" != "no" ; then |
6110 | if test "x${MSSDK}x" = "xx" ; then | |
6111 | MSSDK="C:/Progra~1/Microsoft Platform SDK" | |
6112 | fi | |
6113 | MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` | |
6114 | PATH64="" | |
6115 | 6096 | case "$do64bit" in |
6116 | 6097 | amd64|x64|yes) |
6117 | 6098 | MACHINE="AMD64" ; # default to AMD64 64-bit build |
6118 | PATH64="${MSSDK}/Bin/Win64/x86/AMD64" | |
6119 | 6099 | ;; |
6120 | 6100 | ia64) |
6121 | 6101 | MACHINE="IA64" |
6122 | PATH64="${MSSDK}/Bin/Win64" | |
6123 | 6102 | ;; |
6124 | 6103 | esac |
6125 | if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then | |
6126 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 | |
6127 | $as_echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} | |
6128 | { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ensure latest Platform SDK is installed" >&5 | |
6129 | $as_echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} | |
6130 | do64bit="no" | |
6131 | else | |
6132 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 | |
6133 | $as_echo " Using 64-bit $MACHINE mode" >&6; } | |
6134 | do64bit_ok="yes" | |
6135 | fi | |
6136 | 6104 | fi |
6137 | 6105 | |
6138 | 6106 | if test "$GCC" != "yes" ; then |
6149 | 6117 | for i in $vars; do |
6150 | 6118 | if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then |
6151 | 6119 | # Convert foo.lib to -lfoo for GCC. No-op if not *.lib |
6152 | i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` | |
6120 | i=`echo "$i" | sed -e 's/^\([^-].*\)\.[lL][iI][bB]$/-l\1/'` | |
6153 | 6121 | fi |
6154 | 6122 | PKG_LIBS="$PKG_LIBS $i" |
6155 | 6123 | done |
6161 | 6129 | esac |
6162 | 6130 | |
6163 | 6131 | if test "$do64bit" != "no" ; then |
6164 | # All this magic is necessary for the Win64 SDK RC1 - hobbs | |
6165 | CC="\"${PATH64}/cl.exe\"" | |
6166 | CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" | |
6167 | RC="\"${MSSDK}/bin/rc.exe\"" | |
6168 | lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" | |
6169 | LINKBIN="\"${PATH64}/link.exe\"" | |
6132 | CC="cl.exe" | |
6133 | RC="rc.exe" | |
6134 | lflags="${lflags} -nologo -MACHINE:${MACHINE} " | |
6135 | LINKBIN="link.exe" | |
6170 | 6136 | CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" |
6171 | 6137 | CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" |
6172 | 6138 | # Avoid 'unresolved external symbol __security_cookie' |
6176 | 6142 | for i in $vars; do |
6177 | 6143 | if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then |
6178 | 6144 | # Convert foo.lib to -lfoo for GCC. No-op if not *.lib |
6179 | i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` | |
6145 | i=`echo "$i" | sed -e 's/^\([^-].*\)\.[lL][iI][bB]$/-l\1/'` | |
6180 | 6146 | fi |
6181 | 6147 | PKG_LIBS="$PKG_LIBS $i" |
6182 | 6148 | done |
6325 | 6291 | if test "$ac_cv_cross" = "yes"; then |
6326 | 6292 | case "$do64bit" in |
6327 | 6293 | amd64|x64|yes) |
6328 | CC="x86_64-w64-mingw32-gcc" | |
6294 | CC="x86_64-w64-mingw32-${CC}" | |
6329 | 6295 | LD="x86_64-w64-mingw32-ld" |
6330 | 6296 | AR="x86_64-w64-mingw32-ar" |
6331 | 6297 | RANLIB="x86_64-w64-mingw32-ranlib" |
6332 | 6298 | RC="x86_64-w64-mingw32-windres" |
6333 | 6299 | ;; |
6334 | 6300 | *) |
6335 | CC="i686-w64-mingw32-gcc" | |
6301 | CC="i686-w64-mingw32-${CC}" | |
6336 | 6302 | LD="i686-w64-mingw32-ld" |
6337 | 6303 | AR="i686-w64-mingw32-ar" |
6338 | 6304 | RANLIB="i686-w64-mingw32-ranlib" |
6413 | 6379 | SHLIB_LD="/usr/ccs/bin/ld -G -z text" |
6414 | 6380 | if test "$GCC" = yes; then : |
6415 | 6381 | |
6416 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
6417 | ||
6418 | else | |
6419 | ||
6420 | CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' | |
6421 | ||
6422 | fi | |
6423 | LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' | |
6382 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
6383 | ||
6384 | else | |
6385 | ||
6386 | CC_SEARCH_FLAGS='"-R${LIB_RUNTIME_DIR}"' | |
6387 | ||
6388 | fi | |
6389 | LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' | |
6424 | 6390 | |
6425 | 6391 | else |
6426 | 6392 | |
6435 | 6401 | |
6436 | 6402 | fi |
6437 | 6403 | SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" |
6438 | CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' | |
6404 | CC_SEARCH_FLAGS='"-L${LIB_RUNTIME_DIR}"' | |
6439 | 6405 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
6440 | 6406 | |
6441 | 6407 | fi |
6511 | 6477 | SHLIB_LD='${CC} -shared' |
6512 | 6478 | SHLIB_SUFFIX=".dll" |
6513 | 6479 | SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a" |
6514 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Cygwin version of gcc" >&5 | |
6515 | $as_echo_n "checking for Cygwin version of gcc... " >&6; } | |
6516 | if ${ac_cv_cygwin+:} false; then : | |
6517 | $as_echo_n "(cached) " >&6 | |
6518 | else | |
6519 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | |
6520 | /* end confdefs.h. */ | |
6521 | ||
6522 | #ifdef __CYGWIN__ | |
6523 | #error cygwin | |
6524 | #endif | |
6525 | ||
6526 | int | |
6527 | main () | |
6528 | { | |
6529 | ||
6530 | ; | |
6531 | return 0; | |
6532 | } | |
6533 | _ACEOF | |
6534 | if ac_fn_c_try_compile "$LINENO"; then : | |
6535 | ac_cv_cygwin=no | |
6536 | else | |
6537 | ac_cv_cygwin=yes | |
6538 | fi | |
6539 | rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext | |
6540 | ||
6541 | fi | |
6542 | { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cygwin" >&5 | |
6543 | $as_echo "$ac_cv_cygwin" >&6; } | |
6544 | if test "$ac_cv_cygwin" = "no"; then | |
6545 | as_fn_error $? "${CC} is not a cygwin compiler." "$LINENO" 5 | |
6546 | fi | |
6547 | 6480 | EXEEXT=".exe" |
6548 | 6481 | do64bit_ok=yes |
6549 | 6482 | CC_SEARCH_FLAGS="" |
6668 | 6601 | SHLIB_CFLAGS="+z" |
6669 | 6602 | SHLIB_LD="ld -b" |
6670 | 6603 | LDFLAGS="$LDFLAGS -Wl,-E" |
6671 | CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' | |
6672 | LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' | |
6604 | CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' | |
6605 | LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' | |
6673 | 6606 | LD_LIBRARY_PATH_VAR="SHLIB_PATH" |
6674 | 6607 | |
6675 | 6608 | fi |
6696 | 6629 | SHLIB_LD='${CC} -shared' |
6697 | 6630 | if test $doRpath = yes; then : |
6698 | 6631 | |
6699 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6632 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6700 | 6633 | fi |
6701 | 6634 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
6702 | 6635 | ;; |
6765 | 6698 | SHLIB_LD="ld -b" |
6766 | 6699 | SHLIB_LD_LIBS="" |
6767 | 6700 | LDFLAGS="$LDFLAGS -Wl,-E" |
6768 | CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' | |
6769 | LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' | |
6701 | CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' | |
6702 | LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' | |
6770 | 6703 | LD_LIBRARY_PATH_VAR="SHLIB_PATH" |
6771 | 6704 | |
6772 | 6705 | fi ;; |
6782 | 6715 | |
6783 | 6716 | if test $doRpath = yes; then : |
6784 | 6717 | |
6785 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6786 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' | |
6718 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6719 | LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"' | |
6787 | 6720 | fi |
6788 | 6721 | ;; |
6789 | 6722 | IRIX-6.*) |
6792 | 6725 | SHLIB_SUFFIX=".so" |
6793 | 6726 | if test $doRpath = yes; then : |
6794 | 6727 | |
6795 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6796 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' | |
6728 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6729 | LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"' | |
6797 | 6730 | fi |
6798 | 6731 | if test "$GCC" = yes; then : |
6799 | 6732 | |
6821 | 6754 | SHLIB_SUFFIX=".so" |
6822 | 6755 | if test $doRpath = yes; then : |
6823 | 6756 | |
6824 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6825 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' | |
6757 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6758 | LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"' | |
6826 | 6759 | fi |
6827 | 6760 | |
6828 | 6761 | # Check to enable 64-bit flags for compiler/linker |
6845 | 6778 | |
6846 | 6779 | fi |
6847 | 6780 | ;; |
6848 | Linux*|GNU*|NetBSD-Debian) | |
6781 | Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) | |
6849 | 6782 | SHLIB_CFLAGS="-fPIC" |
6850 | 6783 | SHLIB_SUFFIX=".so" |
6851 | 6784 | |
6855 | 6788 | # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS |
6856 | 6789 | SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS_DEFAULT} -shared' |
6857 | 6790 | LDFLAGS="$LDFLAGS -Wl,--export-dynamic" |
6791 | ||
6792 | case $system in | |
6793 | DragonFly-*|FreeBSD-*) | |
6794 | if test "${TCL_THREADS}" = "1"; then : | |
6795 | ||
6796 | # The -pthread needs to go in the LDFLAGS, not LIBS | |
6797 | LIBS=`echo $LIBS | sed s/-pthread//` | |
6798 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
6799 | LDFLAGS="$LDFLAGS $PTHREAD_LIBS" | |
6800 | fi | |
6801 | ;; | |
6802 | esac | |
6803 | ||
6858 | 6804 | if test $doRpath = yes; then : |
6859 | 6805 | |
6860 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6806 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6861 | 6807 | fi |
6862 | 6808 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
6863 | 6809 | if test "`uname -m`" = "alpha"; then : |
6922 | 6868 | LD_FLAGS="-Wl,--export-dynamic" |
6923 | 6869 | if test $doRpath = yes; then : |
6924 | 6870 | |
6925 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6926 | LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6871 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6872 | LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6927 | 6873 | fi |
6928 | 6874 | ;; |
6929 | 6875 | OpenBSD-*) |
6940 | 6886 | SHLIB_SUFFIX=".so" |
6941 | 6887 | if test $doRpath = yes; then : |
6942 | 6888 | |
6943 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6889 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6944 | 6890 | fi |
6945 | 6891 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
6946 | 6892 | SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' |
6947 | LDFLAGS="-Wl,-export-dynamic" | |
6893 | LDFLAGS="$LDFLAGS -Wl,-export-dynamic" | |
6948 | 6894 | CFLAGS_OPTIMIZE="-O2" |
6949 | 6895 | # On OpenBSD: Compile with -pthread |
6950 | 6896 | # Don't link with -lpthread |
6962 | 6908 | LDFLAGS="$LDFLAGS -export-dynamic" |
6963 | 6909 | if test $doRpath = yes; then : |
6964 | 6910 | |
6965 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6911 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
6966 | 6912 | fi |
6967 | 6913 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
6968 | 6914 | # The -pthread needs to go in the CFLAGS, not LIBS |
6969 | 6915 | LIBS=`echo $LIBS | sed s/-pthread//` |
6970 | 6916 | CFLAGS="$CFLAGS -pthread" |
6971 | 6917 | LDFLAGS="$LDFLAGS -pthread" |
6972 | ;; | |
6973 | DragonFly-*|FreeBSD-*) | |
6974 | # This configuration from FreeBSD Ports. | |
6975 | SHLIB_CFLAGS="-fPIC" | |
6976 | SHLIB_LD="${CC} -shared" | |
6977 | SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$@" | |
6978 | SHLIB_SUFFIX=".so" | |
6979 | LDFLAGS="" | |
6980 | if test $doRpath = yes; then : | |
6981 | ||
6982 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6983 | LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
6984 | fi | |
6985 | # The -pthread needs to go in the LDFLAGS, not LIBS | |
6986 | LIBS=`echo $LIBS | sed s/-pthread//` | |
6987 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
6988 | LDFLAGS="$LDFLAGS $PTHREAD_LIBS" | |
6989 | case $system in | |
6990 | FreeBSD-3.*) | |
6991 | # Version numbers are dot-stripped by system policy. | |
6992 | TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .` | |
6993 | UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' | |
6994 | SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1' | |
6995 | TCL_LIB_VERSIONS_OK=nodots | |
6996 | ;; | |
6997 | esac | |
6998 | 6918 | ;; |
6999 | 6919 | Darwin-*) |
7000 | 6920 | CFLAGS_OPTIMIZE="-Os" |
7304 | 7224 | SHLIB_SUFFIX=".so" |
7305 | 7225 | if test $doRpath = yes; then : |
7306 | 7226 | |
7307 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
7227 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
7308 | 7228 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' |
7309 | 7229 | fi |
7310 | 7230 | if test "$GCC" = yes; then : |
7374 | 7294 | if test "$GCC" = yes; then : |
7375 | 7295 | |
7376 | 7296 | SHLIB_LD='${CC} -shared' |
7377 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
7297 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
7378 | 7298 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
7379 | 7299 | |
7380 | 7300 | else |
7381 | 7301 | |
7382 | 7302 | SHLIB_LD="/usr/ccs/bin/ld -G -z text" |
7383 | CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' | |
7303 | CC_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' | |
7384 | 7304 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
7385 | 7305 | |
7386 | 7306 | fi |
7480 | 7400 | if test "$GCC" = yes; then : |
7481 | 7401 | |
7482 | 7402 | SHLIB_LD='${CC} -shared' |
7483 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
7403 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
7484 | 7404 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
7485 | 7405 | if test "$do64bit_ok" = yes; then : |
7486 | 7406 | |
7517 | 7437 | *) |
7518 | 7438 | SHLIB_LD='/usr/ccs/bin/ld -G -z text';; |
7519 | 7439 | esac |
7520 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
7521 | LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' | |
7440 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
7441 | LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' | |
7522 | 7442 | |
7523 | 7443 | fi |
7524 | 7444 | ;; |
7817 | 7737 | |
7818 | 7738 | |
7819 | 7739 | |
7740 | ||
7741 | ||
7820 | 7742 | # These must be called after we do the basic CFLAGS checks and |
7821 | 7743 | # verify any possible 64-bit or similar switches are necessary |
7822 | 7744 | |
8211 | 8133 | tcl_ok=no |
8212 | 8134 | fi |
8213 | 8135 | |
8214 | DBGX="" | |
8215 | 8136 | if test "$tcl_ok" = "no"; then |
8216 | 8137 | CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG" |
8217 | 8138 | LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" |
8225 | 8146 | $as_echo "yes (standard debugging)" >&6; } |
8226 | 8147 | fi |
8227 | 8148 | fi |
8228 | # TEA specific: | |
8229 | if test "${TEA_PLATFORM}" != "windows" ; then | |
8230 | LDFLAGS_DEFAULT="${LDFLAGS}" | |
8231 | fi | |
8232 | ||
8233 | 8149 | |
8234 | 8150 | |
8235 | 8151 | |
8315 | 8231 | |
8316 | 8232 | if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then |
8317 | 8233 | MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" |
8318 | MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" | |
8234 | MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" | |
8319 | 8235 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext |
8320 | 8236 | /* end confdefs.h. */ |
8321 | 8237 | |
8341 | 8257 | MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\$@ \$(PKG_STUB_OBJECTS)" |
8342 | 8258 | else |
8343 | 8259 | MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" |
8344 | MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" | |
8260 | MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -o \$@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" | |
8345 | 8261 | MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" |
8346 | 8262 | fi |
8347 | 8263 | |
8429 | 8345 | if test -f "${TCL_BIN_DIR}/Makefile" ; then |
8430 | 8346 | # tclConfig.sh is in Tcl build directory |
8431 | 8347 | if test "${TEA_PLATFORM}" = "windows"; then |
8432 | if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" ; then | |
8433 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" | |
8434 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" ; then | |
8435 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" | |
8436 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" ; then | |
8437 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" | |
8438 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" ; then | |
8439 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" | |
8348 | if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then | |
8349 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" | |
8350 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then | |
8351 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" | |
8352 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then | |
8353 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" | |
8354 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then | |
8355 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" | |
8440 | 8356 | fi |
8441 | 8357 | else |
8442 | 8358 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh" |
8444 | 8360 | else |
8445 | 8361 | # tclConfig.sh is in install location |
8446 | 8362 | if test "${TEA_PLATFORM}" = "windows"; then |
8447 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" | |
8363 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" | |
8448 | 8364 | else |
8449 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" | |
8365 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" | |
8450 | 8366 | fi |
8451 | 8367 | list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ |
8452 | 8368 | `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ |
8477 | 8393 | # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) |
8478 | 8394 | eval pkglibdir="${libdir}/itcl${PACKAGE_VERSION}" |
8479 | 8395 | if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then |
8480 | eval itcl_LIB_FLAG="-litcl${PACKAGE_VERSION}${DBGX}" | |
8481 | eval itcl_STUB_LIB_FLAG="-litclstub${PACKAGE_VERSION}${DBGX}" | |
8396 | eval itcl_LIB_FLAG="-litcl${PACKAGE_VERSION}" | |
8397 | eval itcl_STUB_LIB_FLAG="-litclstub${PACKAGE_VERSION}" | |
8482 | 8398 | else |
8483 | eval itcl_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" | |
8484 | eval itcl_STUB_LIB_FLAG="-litclstub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" | |
8399 | eval itcl_LIB_FLAG="-litcl`echo ${PACKAGE_VERSION} | tr -d .`" | |
8400 | eval itcl_STUB_LIB_FLAG="-litclstub`echo ${PACKAGE_VERSION} | tr -d .`" | |
8485 | 8401 | fi |
8486 | 8402 | itcl_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${itcl_LIB_FLAG}" |
8487 | 8403 | itcl_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` ${itcl_LIB_FLAG}" |
9062 | 8978 | # report actual input values of CONFIG_FILES etc. instead of their |
9063 | 8979 | # values after options handling. |
9064 | 8980 | ac_log=" |
9065 | This file was extended by itcl $as_me 4.2.0, which was | |
8981 | This file was extended by itcl $as_me 4.2.1, which was | |
9066 | 8982 | generated by GNU Autoconf 2.69. Invocation command line was |
9067 | 8983 | |
9068 | 8984 | CONFIG_FILES = $CONFIG_FILES |
9115 | 9031 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
9116 | 9032 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
9117 | 9033 | ac_cs_version="\\ |
9118 | itcl config.status 4.2.0 | |
9034 | itcl config.status 4.2.1 | |
9119 | 9035 | configured by $0, generated by GNU Autoconf 2.69, |
9120 | 9036 | with options \\"\$ac_cs_config\\" |
9121 | 9037 |
18 | 18 | # so that we create the export library with the dll. |
19 | 19 | #----------------------------------------------------------------------- |
20 | 20 | |
21 | AC_INIT([itcl], [4.2.0]) | |
21 | AC_INIT([itcl],[4.2.1]) | |
22 | 22 | |
23 | 23 | #-------------------------------------------------------------------- |
24 | 24 | # Call TEA_INIT as the first TEA_ macro to set up initial vars. |
271 | 271 | # which require substituting the AC variables in. Include these here. |
272 | 272 | #-------------------------------------------------------------------- |
273 | 273 | |
274 | AC_OUTPUT([Makefile pkgIndex.tcl itclConfig.sh]) | |
274 | AC_CONFIG_FILES([Makefile pkgIndex.tcl itclConfig.sh]) | |
275 | AC_OUTPUT |
52 | 52 | of memory of at least \fIsize\fR bytes. All \fIsize\fR bytes are |
53 | 53 | initialized to zero. |
54 | 54 | .PP |
55 | A module calls \fBItcl_PreserveData\fR on a pointer \fIptr\fR | |
55 | A module calls \fBItcl_PreserveData\fR on a pointer \fIptr\fR | |
56 | 56 | allocated by \fBItcl_Alloc\fR to prevent deallocation of that memory while |
57 | 57 | the module remains interested in it. |
58 | 58 | .PP |
384 | 384 | . |
385 | 385 | With no arguments, this command returns a list of all object-specific |
386 | 386 | variables and common data members. If \fIvarName\fR is specified, it |
387 | returns information for a specific data member. | |
388 | Flags can be specified with \fIvarName\fR in an arbitrary order. | |
387 | returns information for a specific data member. | |
388 | Flags can be specified with \fIvarName\fR in an arbitrary order. | |
389 | 389 | The result is a list of the specific information in exactly the |
390 | 390 | same order as the flags are specified. |
391 | 391 | |
392 | If no flags are given, this command returns a list | |
392 | If no flags are given, this command returns a list | |
393 | 393 | as if the followings flags have been specified: |
394 | 394 | .IP |
395 | 395 | \fB-protection\fR \fB-type\fR \fB-name\fR \fB-init\fR \fB-value\fR ?\fB-config\fR? |
396 | 396 | |
397 | 397 | The \fB-config\fR result is only present if \fIvarName\fR is a public |
398 | variable. It contains the code that is executed at initialization | |
398 | variable. It contains the code that is executed at initialization | |
399 | 399 | of \fIvarName\fR. The \fB-scope\fR flag gives the namespace context |
400 | of \fIvarName\fR. Herewith the variable can be accessed from outside | |
401 | the object like any other variable. It is similar to the result of | |
400 | of \fIvarName\fR. Herewith the variable can be accessed from outside | |
401 | the object like any other variable. It is similar to the result of | |
402 | 402 | the \fBitcl::scope\fR command. |
403 | 403 | |
404 | 404 | .RE |
0 | itcl2TclOO.c: framePtr->clientData = NULL; | |
1 | itcl2TclOO.c: framePtr->objc = objc; | |
2 | itcl2TclOO.c: framePtr->objv = objv; | |
3 | itcl2TclOO.c: framePtr->procPtr = procPtr; | |
4 | itcl2TclOO.c: if (framePtr == NULL || !(framePtr->isProcCallFrame & FRAME_IS_METHOD)) { | |
5 | itcl2TclOO.c: contextPtr = framePtr->clientData; | |
6 | itcl2TclOO.c: if (framePtr == NULL || !(framePtr->isProcCallFrame & FRAME_IS_METHOD)) { | |
7 | itclMigrate2TclCore.c: framePtr->isProcCallFrame |= FRAME_HAS_RESOLVER; | |
8 | itclMigrate2TclCore.c: framePtr->resolvePtr = resolvePtr; | |
9 | itclMigrate2TclCore.c: framePtr = framePtr->callerVarPtr; | |
10 | itclMigrate2TclCore.c: framePtr = framePtr->callerVarPtr; | |
11 | itclMigrate2TclCore.c: return (Tcl_Namespace *)framePtr->nsPtr; | |
12 | itclMigrate2TclCore.c: return framePtr->clientData; | |
13 | itclMigrate2TclCore.c: ((Interp *)interp)->framePtr->nsPtr = (Namespace *)nsPtr; | |
14 | itclMigrate2TclCore.c: return ((Interp *)interp)->framePtr->objc; | |
15 | itclMigrate2TclCore.c: return ((Interp *)interp)->framePtr->objv; |
84 | 84 | #define ITCL_RELEASE_SERIAL 0 |
85 | 85 | |
86 | 86 | #define ITCL_VERSION "4.2" |
87 | #define ITCL_PATCH_LEVEL "4.2.0" | |
87 | #define ITCL_PATCH_LEVEL "4.2.1" | |
88 | 88 | |
89 | 89 | |
90 | 90 | /* |
51 | 51 | static int |
52 | 52 | FreeCommand( |
53 | 53 | void *data[], |
54 | Tcl_Interp *interp, | |
54 | Tcl_Interp *dummy, | |
55 | 55 | int result) |
56 | 56 | { |
57 | 57 | Command *cmdPtr = (Command *)data[0]; |
58 | 58 | Proc *procPtr = (Proc *)data[1]; |
59 | (void)dummy; | |
59 | 60 | |
60 | 61 | ckfree(cmdPtr); |
61 | 62 | procPtr->cmdPtr = NULL; |
167 | 168 | static int |
168 | 169 | FreeProcedureMethod( |
169 | 170 | void *data[], |
170 | Tcl_Interp *interp, | |
171 | Tcl_Interp *dummy, | |
171 | 172 | int result) |
172 | 173 | { |
173 | 174 | ProcedureMethod *pmPtr = (ProcedureMethod *)data[0]; |
175 | (void)dummy; | |
176 | ||
174 | 177 | ckfree(pmPtr); |
175 | 178 | return result; |
176 | 179 | } |
236 | 239 | Tcl_Object oPtr = (Tcl_Object)clientData; |
237 | 240 | int result; |
238 | 241 | |
239 | result = TclOOInvokeObject(interp, oPtr, clsPtr, PUBLIC_METHOD, | |
242 | if (oPtr) { | |
243 | result = TclOOInvokeObject(interp, oPtr, clsPtr, PUBLIC_METHOD, | |
240 | 244 | objc, objv); |
245 | } else { | |
246 | Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), | |
247 | "cannot access object-specific info without an object context", | |
248 | NULL); | |
249 | return TCL_ERROR; | |
250 | } | |
241 | 251 | return result; |
242 | 252 | } |
243 | 253 | |
351 | 361 | |
352 | 362 | int |
353 | 363 | Itcl_SelfCmd( |
354 | void *clientData, | |
364 | void *dummy, | |
355 | 365 | Tcl_Interp *interp, |
356 | 366 | int objc, |
357 | 367 | Tcl_Obj *const *objv) |
359 | 369 | Interp *iPtr = (Interp *) interp; |
360 | 370 | CallFrame *framePtr = iPtr->varFramePtr; |
361 | 371 | CallContext *contextPtr; |
372 | (void)dummy; | |
362 | 373 | |
363 | 374 | if (!Itcl_IsMethodCallFrame(interp)) { |
364 | 375 | Tcl_AppendResult(interp, TclGetString(objv[0]), |
465 | 465 | static int |
466 | 466 | ItclSetHullWindowName( |
467 | 467 | void *clientData, /* infoPtr */ |
468 | Tcl_Interp *interp, /* current interpreter */ | |
468 | Tcl_Interp *dummy, /* current interpreter */ | |
469 | 469 | int objc, /* number of arguments */ |
470 | 470 | Tcl_Obj *const objv[]) /* argument objects */ |
471 | 471 | { |
472 | 472 | ItclObjectInfo *infoPtr; |
473 | (void)dummy; | |
473 | 474 | |
474 | 475 | infoPtr = (ItclObjectInfo *)clientData; |
475 | if (infoPtr->currIoPtr != NULL) { | |
476 | infoPtr->currIoPtr->hullWindowNamePtr = objv[1]; | |
476 | if ((infoPtr->currIoPtr != NULL) && (objc > 1)) { | |
477 | infoPtr->currIoPtr->hullWindowNamePtr = objv[1]; | |
477 | 478 | Tcl_IncrRefCount(infoPtr->currIoPtr->hullWindowNamePtr); |
478 | 479 | } |
479 | 480 | return TCL_OK; |
363 | 363 | return TCL_ERROR; |
364 | 364 | } |
365 | 365 | /* |
366 | * Install into the master [info] ensemble. | |
366 | * Install into the [info] ensemble. | |
367 | 367 | */ |
368 | 368 | |
369 | 369 | infoCmd = Tcl_FindCommand(interp, "info", NULL, TCL_GLOBAL_ONLY); |
489 | 489 | /* ARGSUSED */ |
490 | 490 | int |
491 | 491 | Itcl_BiIsaCmd( |
492 | void *clientData, /* class definition */ | |
492 | void *dummy, /* class definition */ | |
493 | 493 | Tcl_Interp *interp, /* current interpreter */ |
494 | 494 | int objc, /* number of arguments */ |
495 | 495 | Tcl_Obj *const objv[]) /* argument objects */ |
499 | 499 | |
500 | 500 | ItclClass *contextIclsPtr; |
501 | 501 | ItclObject *contextIoPtr; |
502 | (void)dummy; | |
502 | 503 | |
503 | 504 | /* |
504 | 505 | * Make sure that this command is being invoked in the proper |
568 | 569 | /* ARGSUSED */ |
569 | 570 | int |
570 | 571 | Itcl_BiConfigureCmd( |
571 | void *clientData, /* class definition */ | |
572 | void *dummy, /* class definition */ | |
572 | 573 | Tcl_Interp *interp, /* current interpreter */ |
573 | 574 | int objc, /* number of arguments */ |
574 | 575 | Tcl_Obj *const objv[]) /* argument objects */ |
596 | 597 | int i; |
597 | 598 | int unparsedObjc; |
598 | 599 | int result; |
600 | (void)dummy; | |
599 | 601 | |
600 | 602 | ItclShowArgs(1, "Itcl_BiConfigureCmd", objc, objv); |
601 | 603 | vlookup = NULL; |
842 | 844 | /* ARGSUSED */ |
843 | 845 | int |
844 | 846 | Itcl_BiCgetCmd( |
845 | void *clientData, /* class definition */ | |
847 | void *dummy, /* class definition */ | |
846 | 848 | Tcl_Interp *interp, /* current interpreter */ |
847 | 849 | int objc, /* number of arguments */ |
848 | 850 | Tcl_Obj *const objv[]) /* argument objects */ |
855 | 857 | const char *name; |
856 | 858 | const char *val; |
857 | 859 | int result; |
860 | (void)dummy; | |
858 | 861 | |
859 | 862 | ItclShowArgs(1,"Itcl_BiCgetCmd", objc, objv); |
860 | 863 | /* |
1099 | 1102 | int cObjc; |
1100 | 1103 | int idx; |
1101 | 1104 | Tcl_Obj *objPtr; |
1105 | (void)dummy; | |
1102 | 1106 | |
1103 | 1107 | ItclShowArgs(1, "Itcl_BiChainCmd", objc, objv); |
1104 | 1108 | |
1922 | 1926 | /* ARGSUSED */ |
1923 | 1927 | static int |
1924 | 1928 | ItclExtendedConfigure( |
1925 | void *clientData, /* class definition */ | |
1929 | void *dummy, /* class definition */ | |
1926 | 1930 | Tcl_Interp *interp, /* current interpreter */ |
1927 | 1931 | int objc, /* number of arguments */ |
1928 | 1932 | Tcl_Obj *const objv[]) /* argument objects */ |
1965 | 1969 | int j; |
1966 | 1970 | int isNew; |
1967 | 1971 | int result; |
1968 | int isOneOption; | |
1972 | int isOneOption; | |
1973 | (void)dummy; | |
1969 | 1974 | |
1970 | 1975 | ItclShowArgs(1, "ItclExtendedConfigure", objc, objv); |
1971 | 1976 | ioptPtr = NULL; |
2589 | 2594 | /* ARGSUSED */ |
2590 | 2595 | static int |
2591 | 2596 | ItclExtendedCget( |
2592 | void *clientData, /* class definition */ | |
2597 | void *dummy, /* class definition */ | |
2593 | 2598 | Tcl_Interp *interp, /* current interpreter */ |
2594 | 2599 | int objc, /* number of arguments */ |
2595 | 2600 | Tcl_Obj *const objv[]) /* argument objects */ |
2613 | 2618 | const char *val; |
2614 | 2619 | int i; |
2615 | 2620 | int result; |
2621 | (void)dummy; | |
2616 | 2622 | |
2617 | 2623 | ItclShowArgs(1,"ItclExtendedCget", objc, objv); |
2618 | 2624 | /* |
2827 | 2833 | /* ARGSUSED */ |
2828 | 2834 | static int |
2829 | 2835 | ItclExtendedSetGet( |
2830 | void *clientData, /* class definition */ | |
2836 | void *dummy, /* class definition */ | |
2831 | 2837 | Tcl_Interp *interp, /* current interpreter */ |
2832 | 2838 | int objc, /* number of arguments */ |
2833 | 2839 | Tcl_Obj *const objv[]) /* argument objects */ |
2843 | 2849 | const char *val; |
2844 | 2850 | int result; |
2845 | 2851 | int setValue; |
2852 | (void)dummy; | |
2846 | 2853 | |
2847 | 2854 | ItclShowArgs(1, "ItclExtendedSetGet", objc, objv); |
2848 | 2855 | imvPtr = NULL; |
2945 | 2952 | /* ARGSUSED */ |
2946 | 2953 | int |
2947 | 2954 | Itcl_BiInstallComponentCmd( |
2948 | void *clientData, /* class definition */ | |
2955 | void *dummy, /* class definition */ | |
2949 | 2956 | Tcl_Interp *interp, /* current interpreter */ |
2950 | 2957 | int objc, /* number of arguments */ |
2951 | 2958 | Tcl_Obj *const objv[]) /* argument objects */ |
2961 | 2968 | const char *token; |
2962 | 2969 | int numOpts; |
2963 | 2970 | int result; |
2964 | ||
2971 | (void)dummy; | |
2965 | 2972 | |
2966 | 2973 | ItclShowArgs(1, "Itcl_BiInstallComponentCmd", objc, objv); |
2967 | 2974 | /* |
3080 | 3087 | /* ARGSUSED */ |
3081 | 3088 | static int |
3082 | 3089 | Itcl_BiDestroyCmd( |
3083 | void *clientData, /* class definition */ | |
3090 | void *dummy, /* class definition */ | |
3084 | 3091 | Tcl_Interp *interp, /* current interpreter */ |
3085 | 3092 | int objc, /* number of arguments */ |
3086 | 3093 | Tcl_Obj *const objv[]) /* argument objects */ |
3089 | 3096 | ItclClass *contextIclsPtr; |
3090 | 3097 | ItclObject *contextIoPtr; |
3091 | 3098 | int result; |
3099 | (void)dummy; | |
3092 | 3100 | |
3093 | 3101 | /* |
3094 | 3102 | * Make sure that this command is being invoked in the proper |
3157 | 3165 | /* ARGSUSED */ |
3158 | 3166 | int |
3159 | 3167 | Itcl_BiCallInstanceCmd( |
3160 | void *clientData, /* class definition */ | |
3168 | void *dummy, /* class definition */ | |
3161 | 3169 | Tcl_Interp *interp, /* current interpreter */ |
3162 | 3170 | int objc, /* number of arguments */ |
3163 | 3171 | Tcl_Obj *const objv[]) /* argument objects */ |
3170 | 3178 | ItclObject *ioPtr; |
3171 | 3179 | const char *token; |
3172 | 3180 | int result; |
3181 | (void)dummy; | |
3173 | 3182 | |
3174 | 3183 | /* |
3175 | 3184 | * Make sure that this command is being invoked in the proper |
3224 | 3233 | /* ARGSUSED */ |
3225 | 3234 | int |
3226 | 3235 | Itcl_BiGetInstanceVarCmd( |
3227 | void *clientData, /* class definition */ | |
3236 | void *dummy, /* class definition */ | |
3228 | 3237 | Tcl_Interp *interp, /* current interpreter */ |
3229 | 3238 | int objc, /* number of arguments */ |
3230 | 3239 | Tcl_Obj *const objv[]) /* argument objects */ |
3237 | 3246 | ItclObject *ioPtr; |
3238 | 3247 | const char *token; |
3239 | 3248 | int result; |
3249 | (void)dummy; | |
3240 | 3250 | |
3241 | 3251 | /* |
3242 | 3252 | * Make sure that this command is being invoked in the proper |
3290 | 3300 | /* ARGSUSED */ |
3291 | 3301 | int |
3292 | 3302 | Itcl_BiMyTypeMethodCmd( |
3293 | void *clientData, /* class definition */ | |
3303 | void *dummy, /* class definition */ | |
3294 | 3304 | Tcl_Interp *interp, /* current interpreter */ |
3295 | 3305 | int objc, /* number of arguments */ |
3296 | 3306 | Tcl_Obj *const objv[]) /* argument objects */ |
3300 | 3310 | ItclClass *contextIclsPtr; |
3301 | 3311 | ItclObject *contextIoPtr; |
3302 | 3312 | int i; |
3313 | (void)dummy; | |
3303 | 3314 | |
3304 | 3315 | /* |
3305 | 3316 | * Make sure that this command is being invoked in the proper |
3340 | 3351 | /* ARGSUSED */ |
3341 | 3352 | int |
3342 | 3353 | Itcl_BiMyMethodCmd( |
3343 | void *clientData, /* class definition */ | |
3354 | void *dummy, /* class definition */ | |
3344 | 3355 | Tcl_Interp *interp, /* current interpreter */ |
3345 | 3356 | int objc, /* number of arguments */ |
3346 | 3357 | Tcl_Obj *const objv[]) /* argument objects */ |
3349 | 3360 | int i; |
3350 | 3361 | ItclClass *contextIclsPtr; |
3351 | 3362 | ItclObject *contextIoPtr; |
3363 | (void)dummy; | |
3352 | 3364 | |
3353 | 3365 | /* |
3354 | 3366 | * Make sure that this command is being invoked in the proper |
3389 | 3401 | /* ARGSUSED */ |
3390 | 3402 | int |
3391 | 3403 | Itcl_BiMyProcCmd( |
3392 | void *clientData, /* class definition */ | |
3404 | void *dummy, /* class definition */ | |
3393 | 3405 | Tcl_Interp *interp, /* current interpreter */ |
3394 | 3406 | int objc, /* number of arguments */ |
3395 | 3407 | Tcl_Obj *const objv[]) /* argument objects */ |
3399 | 3411 | ItclClass *contextIclsPtr; |
3400 | 3412 | ItclObject *contextIoPtr; |
3401 | 3413 | int i; |
3414 | (void)dummy; | |
3402 | 3415 | |
3403 | 3416 | /* |
3404 | 3417 | * Make sure that this command is being invoked in the proper |
3440 | 3453 | /* ARGSUSED */ |
3441 | 3454 | int |
3442 | 3455 | Itcl_BiMyTypeVarCmd( |
3443 | void *clientData, /* class definition */ | |
3456 | void *dummy, /* class definition */ | |
3444 | 3457 | Tcl_Interp *interp, /* current interpreter */ |
3445 | 3458 | int objc, /* number of arguments */ |
3446 | 3459 | Tcl_Obj *const objv[]) /* argument objects */ |
3450 | 3463 | ItclClass *contextIclsPtr; |
3451 | 3464 | ItclObject *contextIoPtr; |
3452 | 3465 | int i; |
3466 | (void)dummy; | |
3453 | 3467 | |
3454 | 3468 | /* |
3455 | 3469 | * Make sure that this command is being invoked in the proper |
3492 | 3506 | /* ARGSUSED */ |
3493 | 3507 | int |
3494 | 3508 | Itcl_BiMyVarCmd( |
3495 | void *clientData, /* class definition */ | |
3509 | void *dummy, /* class definition */ | |
3496 | 3510 | Tcl_Interp *interp, /* current interpreter */ |
3497 | 3511 | int objc, /* number of arguments */ |
3498 | 3512 | Tcl_Obj *const objv[]) /* argument objects */ |
3500 | 3514 | Tcl_Obj *resultPtr; |
3501 | 3515 | ItclClass *contextIclsPtr; |
3502 | 3516 | ItclObject *contextIoPtr; |
3517 | (void)dummy; | |
3503 | 3518 | |
3504 | 3519 | /* |
3505 | 3520 | * Make sure that this command is being invoked in the proper |
3510 | 3525 | if (Itcl_GetContext(interp, &contextIclsPtr, &contextIoPtr) != TCL_OK) { |
3511 | 3526 | return TCL_ERROR; |
3512 | 3527 | } |
3513 | if (contextIoPtr != NULL) { | |
3528 | if ((contextIoPtr != NULL) && (objc > 1)) { | |
3514 | 3529 | resultPtr = Tcl_NewStringObj(Tcl_GetString(contextIoPtr->varNsNamePtr), |
3515 | 3530 | -1); |
3516 | 3531 | Tcl_AppendToObj(resultPtr, "::", -1); |
3536 | 3551 | /* ARGSUSED */ |
3537 | 3552 | int |
3538 | 3553 | Itcl_BiItclHullCmd( |
3539 | void *clientData, /* class definition */ | |
3554 | void *dummy, /* class definition */ | |
3540 | 3555 | Tcl_Interp *interp, /* current interpreter */ |
3541 | 3556 | int objc, /* number of arguments */ |
3542 | 3557 | Tcl_Obj *const objv[]) /* argument objects */ |
3544 | 3559 | ItclClass *contextIclsPtr; |
3545 | 3560 | ItclObject *contextIoPtr; |
3546 | 3561 | const char *val; |
3562 | (void)dummy; | |
3563 | (void)objc; | |
3564 | (void)objv; | |
3547 | 3565 | |
3548 | 3566 | /* |
3549 | 3567 | * Make sure that this command is being invoked in the proper |
56 | 56 | { |
57 | 57 | ItclClass *iclsPtr = (ItclClass *)clientData; |
58 | 58 | |
59 | assert(iclsPtr->refCount != 0); | |
59 | 60 | if (iclsPtr->refCount-- <= 1) { |
60 | 61 | ItclFreeClass((char *) clientData); |
61 | 62 | } |
62 | 63 | } |
63 | ||
64 | ||
65 | ||
64 | 66 | /* |
65 | 67 | * ------------------------------------------------------------------------ |
66 | 68 | * Itcl_DeleteMemberFunc() |
132 | 134 | } else { |
133 | 135 | ItclDestroyClass2(iclsPtr); |
134 | 136 | } |
135 | ItclReleaseClass(iclsPtr); | |
136 | 137 | } |
137 | 138 | |
138 | 139 | static int |
145 | 146 | const char *path = (const char *)data[1]; |
146 | 147 | Tcl_Object *oPtr = (Tcl_Object *)data[2]; |
147 | 148 | Tcl_Obj *nameObjPtr = (Tcl_Obj *)data[3]; |
149 | (void)result; | |
148 | 150 | |
149 | 151 | *oPtr = NULL; |
150 | 152 | if (infoPtr->clazzClassPtr) { |
565 | 567 | Tcl_Interp *interp, |
566 | 568 | ItclClass *iclsPtr) |
567 | 569 | { |
570 | (void)interp; | |
571 | (void)iclsPtr; | |
568 | 572 | /* TODO: why is this being skipped? */ |
569 | 573 | return; |
570 | 574 | } |
1634 | 1638 | Tcl_Obj *vnObjPtr; |
1635 | 1639 | int newEntry, processAncestors; |
1636 | 1640 | size_t varLen; |
1637 | ||
1641 | ||
1638 | 1642 | /* (de)qualify to simple name */ |
1639 | 1643 | varName = simpleName = lookupName; |
1640 | 1644 | while(*varName) { |
1643 | 1647 | }; |
1644 | 1648 | } |
1645 | 1649 | vnObjPtr = Tcl_NewStringObj(simpleName, -1); |
1646 | ||
1650 | ||
1647 | 1651 | processAncestors = simpleName != lookupName; |
1648 | 1652 | |
1649 | 1653 | Tcl_DStringInit(&buffer); |
1706 | 1710 | } |
1707 | 1711 | /* check leastQualName correction needed */ |
1708 | 1712 | if (!vlookup->leastQualName) { |
1709 | vlookup->leastQualName = | |
1713 | vlookup->leastQualName = (char *) | |
1710 | 1714 | Tcl_GetHashKey(&iclsPtr->resolveVars, hPtr); |
1711 | 1715 | } |
1712 | 1716 | /* reset vlookup for full-qualified names - new lookup */ |
1724 | 1728 | setResVar: |
1725 | 1729 | |
1726 | 1730 | vlookup->ivPtr = ivPtr; |
1727 | vlookup->leastQualName = | |
1731 | vlookup->leastQualName = (char *) | |
1728 | 1732 | Tcl_GetHashKey(&iclsPtr->resolveVars, hPtr); |
1729 | 1733 | |
1730 | 1734 | /* |
1858 | 1862 | if (hPtr == NULL) { |
1859 | 1863 | break; |
1860 | 1864 | } |
1861 | clookupPtr = Tcl_GetHashValue(hPtr); | |
1865 | clookupPtr = (ItclCmdLookup *)Tcl_GetHashValue(hPtr); | |
1862 | 1866 | ckfree((char *)clookupPtr); |
1863 | 1867 | Tcl_DeleteHashEntry(hPtr); |
1864 | 1868 | } |
2101 | 2105 | |
2102 | 2106 | /* |
2103 | 2107 | * ------------------------------------------------------------------------ |
2104 | * ItclCreateMethodVariable(), Itcl_CreateMethodVariable() | |
2108 | * ItclCreateMethodVariable() | |
2105 | 2109 | * |
2106 | 2110 | * Creates a new class methdovariable definition. If this is a public |
2107 | 2111 | * methodvariable, |
168 | 168 | /* ARGSUSED */ |
169 | 169 | int |
170 | 170 | Itcl_FindClassesCmd( |
171 | ClientData clientData, /* class/object info */ | |
171 | ClientData dummy, /* class/object info */ | |
172 | 172 | Tcl_Interp *interp, /* current interpreter */ |
173 | 173 | int objc, /* number of arguments */ |
174 | 174 | Tcl_Obj *const objv[]) /* argument objects */ |
188 | 188 | int newEntry; |
189 | 189 | int handledActiveNs; |
190 | 190 | int forceFullNames = 0; |
191 | (void)dummy; | |
191 | 192 | |
192 | 193 | ItclShowArgs(2, "Itcl_FindClassesCmd", objc, objv); |
193 | 194 | if (objc > 2) { |
301 | 302 | */ |
302 | 303 | int |
303 | 304 | Itcl_FindObjectsCmd( |
304 | ClientData clientData, /* class/object info */ | |
305 | ClientData dummy, /* class/object info */ | |
305 | 306 | Tcl_Interp *interp, /* current interpreter */ |
306 | 307 | int objc, /* number of arguments */ |
307 | 308 | Tcl_Obj *const objv[]) /* argument objects */ |
331 | 332 | Tcl_CmdInfo cmdInfo; |
332 | 333 | Tcl_Namespace *nsPtr; |
333 | 334 | Tcl_Obj *objPtr; |
335 | (void)dummy; | |
334 | 336 | |
335 | 337 | /* |
336 | 338 | * Parse arguments: |
500 | 502 | /* ARGSUSED */ |
501 | 503 | static int |
502 | 504 | NRDelClassCmd( |
503 | ClientData clientData, /* unused */ | |
505 | ClientData dummy, /* unused */ | |
504 | 506 | Tcl_Interp *interp, /* current interpreter */ |
505 | 507 | int objc, /* number of arguments */ |
506 | 508 | Tcl_Obj *const objv[]) /* argument objects */ |
508 | 510 | int i; |
509 | 511 | char *name; |
510 | 512 | ItclClass *iclsPtr; |
513 | (void)dummy; | |
511 | 514 | |
512 | 515 | ItclShowArgs(1, "Itcl_DelClassCmd", objc, objv); |
513 | 516 | /* |
585 | 588 | |
586 | 589 | static int |
587 | 590 | NRDelObjectCmd( |
588 | ClientData clientData, /* object management info */ | |
591 | ClientData dummy, /* object management info */ | |
589 | 592 | Tcl_Interp *interp, /* current interpreter */ |
590 | 593 | int objc, /* number of arguments */ |
591 | 594 | Tcl_Obj *const objv[]) /* argument objects */ |
595 | 598 | void *callbackPtr; |
596 | 599 | int i; |
597 | 600 | int result; |
601 | (void)dummy; | |
598 | 602 | |
599 | 603 | ItclShowArgs(1, "Itcl_DelObjectCmd", objc, objv); |
600 | 604 | /* |
687 | 691 | char *token; |
688 | 692 | int doAppend; |
689 | 693 | int result; |
694 | (void)dummy; | |
690 | 695 | |
691 | 696 | ItclShowArgs(1, "Itcl_ScopeCmd", objc, objv); |
692 | 697 | if (objc != 2) { |
906 | 911 | Tcl_Obj *objPtr; |
907 | 912 | const char *token; |
908 | 913 | int pos; |
914 | (void)dummy; | |
909 | 915 | |
910 | 916 | ItclShowArgs(1, "Itcl_CodeCmd", objc, objv); |
911 | 917 | /* |
996 | 1002 | */ |
997 | 1003 | int |
998 | 1004 | Itcl_IsObjectCmd( |
999 | ClientData clientData, /* class/object info */ | |
1005 | ClientData dummy, /* class/object info */ | |
1000 | 1006 | Tcl_Interp *interp, /* current interpreter */ |
1001 | 1007 | int objc, /* number of arguments */ |
1002 | 1008 | Tcl_Obj *const objv[]) /* argument objects */ |
1011 | 1017 | Tcl_Command cmd; |
1012 | 1018 | Tcl_Namespace *contextNs = NULL; |
1013 | 1019 | ItclClass *iclsPtr = NULL; |
1020 | (void)dummy; | |
1014 | 1021 | |
1015 | 1022 | /* |
1016 | 1023 | * Handle the arguments. |
1114 | 1121 | */ |
1115 | 1122 | int |
1116 | 1123 | Itcl_IsClassCmd( |
1117 | ClientData clientData, /* class/object info */ | |
1124 | ClientData dummy, /* class/object info */ | |
1118 | 1125 | Tcl_Interp *interp, /* current interpreter */ |
1119 | 1126 | int objc, /* number of arguments */ |
1120 | 1127 | Tcl_Obj *const objv[]) /* argument objects */ |
1124 | 1131 | char *name; |
1125 | 1132 | ItclClass *iclsPtr = NULL; |
1126 | 1133 | Tcl_Namespace *contextNs = NULL; |
1134 | (void)dummy; | |
1127 | 1135 | |
1128 | 1136 | /* |
1129 | 1137 | * Need itcl::is class classname |
1182 | 1190 | { |
1183 | 1191 | Tcl_Obj **newObjv; |
1184 | 1192 | int result; |
1193 | (void)dummy; | |
1185 | 1194 | |
1186 | 1195 | ItclShowArgs(1, "Itcl_FilterCmd", objc, objv); |
1187 | 1196 | /* Tcl_Namespace *contextNs = Tcl_GetCurrentNamespace(interp); */ |
1222 | 1231 | int objc, /* number of arguments */ |
1223 | 1232 | Tcl_Obj *const objv[]) /* argument objects */ |
1224 | 1233 | { |
1234 | (void)dummy; | |
1235 | ||
1225 | 1236 | ItclShowArgs(1, "Itcl_FilterDeleteCmd", objc, objv); |
1226 | 1237 | /* Tcl_Namespace *contextNs = Tcl_GetCurrentNamespace(interp); */ |
1227 | 1238 | |
1251 | 1262 | Tcl_Method mPtr; |
1252 | 1263 | ItclObjectInfo *infoPtr; |
1253 | 1264 | ItclClass *iclsPtr; |
1265 | (void)dummy; | |
1254 | 1266 | |
1255 | 1267 | ItclShowArgs(1, "Itcl_ForwardAddCmd", objc, objv); |
1256 | 1268 | if (objc < 3) { |
1295 | 1307 | int objc, /* number of arguments */ |
1296 | 1308 | Tcl_Obj *const objv[]) /* argument objects */ |
1297 | 1309 | { |
1310 | (void)dummy; | |
1311 | ||
1298 | 1312 | ItclShowArgs(1, "Itcl_ForwardDeleteCmd", objc, objv); |
1299 | 1313 | /* Tcl_Namespace *contextNs = Tcl_GetCurrentNamespace(interp); */ |
1300 | 1314 | |
1321 | 1335 | { |
1322 | 1336 | Tcl_Obj **newObjv; |
1323 | 1337 | int result; |
1338 | (void)dummy; | |
1324 | 1339 | |
1325 | 1340 | ItclShowArgs(1, "Itcl_MixinAddCmd", objc, objv); |
1326 | 1341 | if (objc < 3) { |
1359 | 1374 | int objc, /* number of arguments */ |
1360 | 1375 | Tcl_Obj *const objv[]) /* argument objects */ |
1361 | 1376 | { |
1377 | (void)dummy; | |
1378 | ||
1362 | 1379 | ItclShowArgs(1, "Itcl_MixinDeleteCmd", objc, objv); |
1363 | 1380 | /* Tcl_Namespace *contextNs = Tcl_GetCurrentNamespace(interp); */ |
1364 | 1381 | |
1715 | 1732 | /* ARGSUSED */ |
1716 | 1733 | int |
1717 | 1734 | Itcl_AddComponentCmd( |
1718 | ClientData clientData, /* infoPtr */ | |
1735 | ClientData dummy, /* infoPtr */ | |
1719 | 1736 | Tcl_Interp *interp, /* current interpreter */ |
1720 | 1737 | int objc, /* number of arguments */ |
1721 | 1738 | Tcl_Obj *const objv[]) /* argument objects */ |
1735 | 1752 | const char *varName; |
1736 | 1753 | int isNew; |
1737 | 1754 | int result; |
1755 | (void)dummy; | |
1738 | 1756 | |
1739 | 1757 | result = TCL_OK; |
1740 | 1758 | contextIoPtr = NULL; |
1879 | 1897 | /* ARGSUSED */ |
1880 | 1898 | int |
1881 | 1899 | Itcl_SetComponentCmd( |
1882 | ClientData clientData, /* infoPtr */ | |
1900 | ClientData dummy, /* infoPtr */ | |
1883 | 1901 | Tcl_Interp *interp, /* current interpreter */ |
1884 | 1902 | int objc, /* number of arguments */ |
1885 | 1903 | Tcl_Obj *const objv[]) /* argument objects */ |
1894 | 1912 | const char *name; |
1895 | 1913 | const char *val; |
1896 | 1914 | int result; |
1915 | (void)dummy; | |
1897 | 1916 | |
1898 | 1917 | result = TCL_OK; |
1899 | 1918 | contextIoPtr = NULL; |
81 | 81 | * Data shared by ensemble access commands and ensemble parser: |
82 | 82 | */ |
83 | 83 | typedef struct EnsembleParser { |
84 | Tcl_Interp* master; /* master interp containing ensembles */ | |
85 | Tcl_Interp* parser; /* slave interp for parsing */ | |
84 | Tcl_Interp* interp; /* interpreter containing ensembles */ | |
85 | Tcl_Interp* parser; /* child interp for parsing */ | |
86 | 86 | Ensemble* ensData; /* add parts to this ensemble */ |
87 | 87 | } EnsembleParser; |
88 | 88 | |
1680 | 1680 | ensName = Tcl_GetString(objv[1]); |
1681 | 1681 | |
1682 | 1682 | if (ensData) { |
1683 | if (FindEnsemblePart(ensInfo->master, ensData, ensName, &ensPart) != TCL_OK) { | |
1683 | if (FindEnsemblePart(ensInfo->interp, ensData, ensName, &ensPart) != TCL_OK) { | |
1684 | 1684 | ensPart = NULL; |
1685 | 1685 | } |
1686 | 1686 | if (ensPart == NULL) { |
1687 | if (CreateEnsemble(ensInfo->master, ensData, ensName) != TCL_OK) { | |
1688 | Tcl_TransferResult(ensInfo->master, TCL_ERROR, interp); | |
1687 | if (CreateEnsemble(ensInfo->interp, ensData, ensName) != TCL_OK) { | |
1688 | Tcl_TransferResult(ensInfo->interp, TCL_ERROR, interp); | |
1689 | 1689 | return TCL_ERROR; |
1690 | 1690 | } |
1691 | if (FindEnsemblePart(ensInfo->master, ensData, ensName, &ensPart) | |
1691 | if (FindEnsemblePart(ensInfo->interp, ensData, ensName, &ensPart) | |
1692 | 1692 | != TCL_OK) { |
1693 | 1693 | Tcl_Panic("Itcl_EnsembleCmd: can't create ensemble"); |
1694 | 1694 | } |
1695 | 1695 | } |
1696 | 1696 | |
1697 | 1697 | cmd = ensPart->cmdPtr; |
1698 | infoPtr = (ItclObjectInfo *)Tcl_GetAssocData(ensInfo->master, ITCL_INTERP_DATA, NULL); | |
1698 | infoPtr = (ItclObjectInfo *)Tcl_GetAssocData(ensInfo->interp, ITCL_INTERP_DATA, NULL); | |
1699 | 1699 | hPtr = Tcl_FindHashEntry(&infoPtr->ensembleInfo->ensembles, |
1700 | 1700 | (char *)ensPart->cmdPtr); |
1701 | 1701 | if (hPtr == NULL) { |
1763 | 1763 | |
1764 | 1764 | /* |
1765 | 1765 | * Copy the result from the parser interpreter to the |
1766 | * master interpreter. If an error was encountered, | |
1766 | * parent interpreter. If an error was encountered, | |
1767 | 1767 | * copy the error info first, and then set the result. |
1768 | 1768 | * Otherwise, the offending command is reported twice. |
1769 | 1769 | */ |
1794 | 1794 | * |
1795 | 1795 | * GetEnsembleParser -- |
1796 | 1796 | * |
1797 | * Returns the slave interpreter that acts as a parser for | |
1797 | * Returns the child interpreter that acts as a parser for | |
1798 | 1798 | * the body of an "ensemble" definition. The first time that |
1799 | 1799 | * this is called for an interpreter, the parser is created |
1800 | 1800 | * and registered as associated data. After that, it is |
1827 | 1827 | } |
1828 | 1828 | |
1829 | 1829 | /* |
1830 | * Create a slave interpreter that can be used to parse | |
1830 | * Create a child interpreter that can be used to parse | |
1831 | 1831 | * the body of an ensemble definition. |
1832 | 1832 | */ |
1833 | 1833 | ensInfo = (EnsembleParser*)ckalloc(sizeof(EnsembleParser)); |
1834 | ensInfo->master = interp; | |
1834 | ensInfo->interp = interp; | |
1835 | 1835 | ensInfo->parser = Tcl_CreateInterp(); |
1836 | 1836 | ensInfo->ensData = NULL; |
1837 | 1837 | |
1866 | 1866 | * DeleteEnsParser -- |
1867 | 1867 | * |
1868 | 1868 | * Called when an interpreter is destroyed to clean up the |
1869 | * ensemble parser within it. Destroys the slave interpreter | |
1869 | * ensemble parser within it. Destroys the child interpreter | |
1870 | 1870 | * and frees up the data associated with it. |
1871 | 1871 | * |
1872 | 1872 | * Results: |
1881 | 1881 | static void |
1882 | 1882 | DeleteEnsParser( |
1883 | 1883 | ClientData clientData, /* client data for ensemble-related commands */ |
1884 | Tcl_Interp *interp) /* interpreter containing the data */ | |
1884 | Tcl_Interp *dummy) /* interpreter containing the data */ | |
1885 | 1885 | { |
1886 | 1886 | EnsembleParser* ensInfo = (EnsembleParser*)clientData; |
1887 | (void)dummy; | |
1888 | ||
1887 | 1889 | Tcl_DeleteInterp(ensInfo->parser); |
1888 | 1890 | ckfree((char*)ensInfo); |
1889 | 1891 | } |
1965 | 1967 | result = TCL_ERROR; |
1966 | 1968 | goto errorOut; |
1967 | 1969 | } |
1968 | if (Tcl_CreateProc(ensInfo->master, cmdInfo.namespacePtr, partName, objv[2], objv[3], | |
1970 | if (Tcl_CreateProc(ensInfo->interp, cmdInfo.namespacePtr, partName, objv[2], objv[3], | |
1969 | 1971 | &procPtr) != TCL_OK) { |
1970 | Tcl_TransferResult(ensInfo->master, TCL_ERROR, interp); | |
1972 | Tcl_TransferResult(ensInfo->interp, TCL_ERROR, interp); | |
1971 | 1973 | result = TCL_ERROR; |
1972 | 1974 | goto errorOut; |
1973 | 1975 | } |
1980 | 1982 | * if we try to compile the Tcl code for the part. If |
1981 | 1983 | * anything goes wrong, clean up before bailing out. |
1982 | 1984 | */ |
1983 | result = AddEnsemblePart(ensInfo->master, ensData, partName, usage, | |
1985 | result = AddEnsemblePart(ensInfo->interp, ensData, partName, usage, | |
1984 | 1986 | (Tcl_ObjCmdProc *)Tcl_GetObjInterpProc(), procPtr, _Tcl_ProcDeleteProc, |
1985 | 1987 | ITCL_ENSEMBLE_ENSEMBLE, &ensPart); |
1986 | 1988 | if (result == TCL_ERROR) { |
1987 | 1989 | _Tcl_ProcDeleteProc(procPtr); |
1988 | 1990 | } |
1989 | Tcl_TransferResult(ensInfo->master, result, interp); | |
1991 | Tcl_TransferResult(ensInfo->interp, result, interp); | |
1990 | 1992 | |
1991 | 1993 | errorOut: |
1992 | 1994 | Tcl_DecrRefCount(usagePtr); |
2030 | 2032 | |
2031 | 2033 | char *cmdName; |
2032 | 2034 | Tcl_Obj *objPtr; |
2035 | (void)objc; | |
2033 | 2036 | |
2034 | 2037 | cmdName = Tcl_GetString(objv[0]); |
2035 | 2038 | |
2129 | 2132 | ItclObjectInfo *infoPtr; |
2130 | 2133 | EnsemblePart *ensPart; |
2131 | 2134 | Ensemble *ensData; |
2135 | (void)dummy; | |
2132 | 2136 | |
2133 | 2137 | ItclShowArgs(2, "EnsembleUnknownCmd", objc, objv); |
2134 | 2138 | cmd = Tcl_GetCommandFromObj(interp, objv[1]); |
81 | 81 | Tcl_Obj **usagePtr, /* store usage message for arguments here */ |
82 | 82 | ItclArgList **arglistPtrPtr, |
83 | 83 | /* returns pointer to parsed argument list */ |
84 | ItclMemberFunc *mPtr, | |
84 | ItclMemberFunc *dummy, | |
85 | 85 | const char *commandName) |
86 | 86 | { |
87 | 87 | int argc; |
93 | 93 | int i; |
94 | 94 | int hadArgsArgument; |
95 | 95 | int result; |
96 | (void)dummy; | |
96 | 97 | |
97 | 98 | *arglistPtrPtr = NULL; |
98 | 99 | lastArglistPtr = NULL; |
295 | 296 | */ |
296 | 297 | Tcl_Obj* |
297 | 298 | Itcl_CreateArgs( |
298 | Tcl_Interp *interp, /* current interpreter */ | |
299 | Tcl_Interp *dummy, /* current interpreter */ | |
299 | 300 | const char *string, /* first command word */ |
300 | 301 | int objc, /* number of arguments */ |
301 | 302 | Tcl_Obj *const objv[]) /* argument objects */ |
302 | 303 | { |
303 | 304 | int i; |
304 | 305 | Tcl_Obj *listPtr; |
306 | (void)dummy; | |
305 | 307 | |
306 | 308 | ItclShowArgs(1, "Itcl_CreateArgs", objc, objv); |
307 | 309 | listPtr = Tcl_NewListObj(objc+2, NULL); |
322 | 324 | |
323 | 325 | int |
324 | 326 | ItclEnsembleSubCmd( |
325 | ClientData clientData, | |
327 | ClientData dummy, | |
326 | 328 | Tcl_Interp *interp, |
327 | 329 | const char *ensembleName, |
328 | 330 | int objc, |
332 | 334 | int result; |
333 | 335 | Tcl_Obj **newObjv; |
334 | 336 | int isRootEnsemble; |
337 | (void)dummy; | |
338 | (void)ensembleName; | |
339 | (void)functionName; | |
340 | ||
335 | 341 | ItclShowArgs(2, functionName, objc, objv); |
336 | 342 | |
337 | 343 | newObjv = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj *)*(objc)); |
312 | 312 | static int |
313 | 313 | InfoGutsFinish( |
314 | 314 | ClientData data[], |
315 | Tcl_Interp *interp, | |
315 | TCL_UNUSED(Tcl_Interp *), | |
316 | 316 | int result) |
317 | 317 | { |
318 | 318 | Tcl_CallFrame *framePtr = (Tcl_CallFrame *) data[0]; |
555 | 555 | ItclGetInfoUsage( |
556 | 556 | Tcl_Interp *interp, |
557 | 557 | Tcl_Obj *objPtr, /* returns: summary of usage info */ |
558 | ItclObjectInfo *infoPtr, | |
558 | TCL_UNUSED(ItclObjectInfo *), | |
559 | 559 | ItclClass *iclsPtr) |
560 | 560 | { |
561 | 561 | const char *spaces = " "; |
562 | 562 | int i; |
563 | ||
564 | 563 | ItclObject *ioPtr; |
564 | ||
565 | 565 | if (iclsPtr == NULL) { |
566 | 566 | if (TCL_ERROR == Itcl_GetContext(interp, &iclsPtr, &ioPtr)) { |
567 | 567 | return; |
599 | 599 | ItclGetInfoDelegatedUsage( |
600 | 600 | Tcl_Interp *interp, |
601 | 601 | Tcl_Obj *objPtr, /* returns: summary of usage info */ |
602 | ItclObjectInfo *infoPtr) | |
602 | TCL_UNUSED(ItclObjectInfo *)) | |
603 | 603 | { |
604 | 604 | ItclClass *iclsPtr; |
605 | 605 | const char *name; |
609 | 609 | int i; |
610 | 610 | |
611 | 611 | ItclObject *ioPtr; |
612 | ||
612 | 613 | if (TCL_ERROR == Itcl_GetContext(interp, &iclsPtr, &ioPtr)) { |
613 | 614 | return; |
614 | 615 | } |
659 | 660 | /* ARGSUSED */ |
660 | 661 | int |
661 | 662 | Itcl_BiInfoClassCmd( |
662 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
663 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
663 | 664 | Tcl_Interp *interp, /* current interpreter */ |
664 | 665 | int objc, /* number of arguments */ |
665 | 666 | Tcl_Obj *const objv[]) /* argument objects */ |
739 | 740 | /* ARGSUSED */ |
740 | 741 | static int |
741 | 742 | Itcl_BiInfoClassOptionsCmd( |
742 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
743 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
743 | 744 | Tcl_Interp *interp, /* current interpreter */ |
744 | 745 | int objc, /* number of arguments */ |
745 | 746 | Tcl_Obj *const objv[]) /* argument objects */ |
850 | 851 | /* ARGSUSED */ |
851 | 852 | static int |
852 | 853 | Itcl_BiInfoContextCmd( |
853 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
854 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
854 | 855 | Tcl_Interp *interp, /* current interpreter */ |
855 | 856 | int objc, /* number of arguments */ |
856 | 857 | Tcl_Obj *const objv[]) /* argument objects */ |
889 | 890 | /* ARGSUSED */ |
890 | 891 | int |
891 | 892 | Itcl_BiInfoInheritCmd( |
892 | ClientData clientdata, /* ItclObjectInfo Ptr */ | |
893 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
893 | 894 | Tcl_Interp *interp, /* current interpreter */ |
894 | 895 | int objc, /* number of arguments */ |
895 | 896 | Tcl_Obj *const objv[]) /* argument objects */ |
949 | 950 | /* ARGSUSED */ |
950 | 951 | int |
951 | 952 | Itcl_BiInfoHeritageCmd( |
952 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
953 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
953 | 954 | Tcl_Interp *interp, /* current interpreter */ |
954 | 955 | int objc, /* number of arguments */ |
955 | 956 | Tcl_Obj *const objv[]) /* argument objects */ |
1019 | 1020 | /* ARGSUSED */ |
1020 | 1021 | int |
1021 | 1022 | Itcl_BiInfoFunctionCmd( |
1022 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
1023 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
1023 | 1024 | Tcl_Interp *interp, /* current interpreter */ |
1024 | 1025 | int objc, /* number of arguments */ |
1025 | 1026 | Tcl_Obj *const objv[]) /* argument objects */ |
1259 | 1260 | /* ARGSUSED */ |
1260 | 1261 | int |
1261 | 1262 | Itcl_BiInfoVariableCmd( |
1262 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
1263 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
1263 | 1264 | Tcl_Interp *interp, /* current interpreter */ |
1264 | 1265 | int objc, /* number of arguments */ |
1265 | 1266 | Tcl_Obj *const objv[]) /* argument objects */ |
1828 | 1829 | /* ARGSUSED */ |
1829 | 1830 | int |
1830 | 1831 | Itcl_BiInfoBodyCmd( |
1831 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
1832 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
1832 | 1833 | Tcl_Interp *interp, /* current interpreter */ |
1833 | 1834 | int objc, /* number of arguments */ |
1834 | 1835 | Tcl_Obj *const objv[]) /* argument objects */ |
1931 | 1932 | /* ARGSUSED */ |
1932 | 1933 | int |
1933 | 1934 | Itcl_BiInfoArgsCmd( |
1934 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
1935 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
1935 | 1936 | Tcl_Interp *interp, /* current interpreter */ |
1936 | 1937 | int objc, /* number of arguments */ |
1937 | 1938 | Tcl_Obj *const objv[]) /* argument objects */ |
2040 | 2041 | /* ARGSUSED */ |
2041 | 2042 | int |
2042 | 2043 | Itcl_BiInfoOptionCmd( |
2043 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2044 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2044 | 2045 | Tcl_Interp *interp, /* current interpreter */ |
2045 | 2046 | int objc, /* number of arguments */ |
2046 | 2047 | Tcl_Obj *const objv[]) /* argument objects */ |
2343 | 2344 | /* ARGSUSED */ |
2344 | 2345 | int |
2345 | 2346 | Itcl_BiInfoComponentCmd( |
2346 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2347 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2347 | 2348 | Tcl_Interp *interp, /* current interpreter */ |
2348 | 2349 | int objc, /* number of arguments */ |
2349 | 2350 | Tcl_Obj *const objv[]) /* argument objects */ |
2562 | 2563 | /* ARGSUSED */ |
2563 | 2564 | static int |
2564 | 2565 | Itcl_BiInfoWidgetCmd( |
2565 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2566 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2566 | 2567 | Tcl_Interp *interp, /* current interpreter */ |
2567 | 2568 | int objc, /* number of arguments */ |
2568 | 2569 | Tcl_Obj *const objv[]) /* argument objects */ |
2654 | 2655 | /* ARGSUSED */ |
2655 | 2656 | static int |
2656 | 2657 | Itcl_BiInfoExtendedClassCmd( |
2657 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2658 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2658 | 2659 | Tcl_Interp *interp, /* current interpreter */ |
2659 | 2660 | int objc, /* number of arguments */ |
2660 | 2661 | Tcl_Obj *const objv[]) /* argument objects */ |
2714 | 2715 | } |
2715 | 2716 | contextIclsPtr = Tcl_GetHashValue(hPtr); |
2716 | 2717 | |
2718 | #elif defined __cplusplus | |
2719 | (void)interp; | |
2720 | (void)objc; | |
2721 | (void)objv; | |
2717 | 2722 | #endif |
2718 | 2723 | |
2719 | 2724 | return TCL_OK; |
2737 | 2742 | /* ARGSUSED */ |
2738 | 2743 | static int |
2739 | 2744 | Itcl_BiInfoDelegatedCmd( |
2740 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2745 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2741 | 2746 | Tcl_Interp *interp, /* current interpreter */ |
2742 | 2747 | int objc, /* number of arguments */ |
2743 | 2748 | Tcl_Obj *const objv[]) /* argument objects */ |
2797 | 2802 | } |
2798 | 2803 | contextIclsPtr = Tcl_GetHashValue(hPtr); |
2799 | 2804 | |
2805 | #elif defined __cplusplus | |
2806 | (void)interp; | |
2807 | (void)objc; | |
2808 | (void)objv; | |
2800 | 2809 | #endif |
2801 | 2810 | |
2802 | 2811 | return TCL_OK; |
2818 | 2827 | /* ARGSUSED */ |
2819 | 2828 | static int |
2820 | 2829 | Itcl_BiInfoTypeCmd( |
2821 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2830 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2822 | 2831 | Tcl_Interp *interp, /* current interpreter */ |
2823 | 2832 | int objc, /* number of arguments */ |
2824 | 2833 | Tcl_Obj *const objv[]) /* argument objects */ |
2906 | 2915 | /* ARGSUSED */ |
2907 | 2916 | static int |
2908 | 2917 | Itcl_BiInfoHullTypeCmd( |
2909 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2918 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2910 | 2919 | Tcl_Interp *interp, /* current interpreter */ |
2911 | 2920 | int objc, /* number of arguments */ |
2912 | 2921 | Tcl_Obj *const objv[]) /* argument objects */ |
2973 | 2982 | /* ARGSUSED */ |
2974 | 2983 | static int |
2975 | 2984 | Itcl_BiInfoDefaultCmd( |
2976 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
2985 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
2977 | 2986 | Tcl_Interp *interp, /* current interpreter */ |
2978 | 2987 | int objc, /* number of arguments */ |
2979 | 2988 | Tcl_Obj *const objv[]) /* argument objects */ |
3068 | 3077 | /* ARGSUSED */ |
3069 | 3078 | static int |
3070 | 3079 | Itcl_BiInfoMethodCmd( |
3071 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3080 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3072 | 3081 | Tcl_Interp *interp, /* current interpreter */ |
3073 | 3082 | int objc, /* number of arguments */ |
3074 | 3083 | Tcl_Obj *const objv[]) /* argument objects */ |
3295 | 3304 | /* ARGSUSED */ |
3296 | 3305 | static int |
3297 | 3306 | Itcl_BiInfoMethodsCmd( |
3298 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3307 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3299 | 3308 | Tcl_Interp *interp, /* current interpreter */ |
3300 | 3309 | int objc, /* number of arguments */ |
3301 | 3310 | Tcl_Obj *const objv[]) /* argument objects */ |
3393 | 3402 | /* ARGSUSED */ |
3394 | 3403 | static int |
3395 | 3404 | Itcl_BiInfoOptionsCmd( |
3396 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3405 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3397 | 3406 | Tcl_Interp *interp, /* current interpreter */ |
3398 | 3407 | int objc, /* number of arguments */ |
3399 | 3408 | Tcl_Obj *const objv[]) /* argument objects */ |
3566 | 3575 | /* ARGSUSED */ |
3567 | 3576 | static int |
3568 | 3577 | Itcl_BiInfoComponentsCmd( |
3569 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3578 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3570 | 3579 | Tcl_Interp *interp, /* current interpreter */ |
3571 | 3580 | int objc, /* number of arguments */ |
3572 | 3581 | Tcl_Obj *const objv[]) /* argument objects */ |
3637 | 3646 | /* ARGSUSED */ |
3638 | 3647 | static int |
3639 | 3648 | Itcl_BiInfoTypeMethodCmd( |
3640 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3649 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3641 | 3650 | Tcl_Interp *interp, /* current interpreter */ |
3642 | 3651 | int objc, /* number of arguments */ |
3643 | 3652 | Tcl_Obj *const objv[]) /* argument objects */ |
3865 | 3874 | /* ARGSUSED */ |
3866 | 3875 | static int |
3867 | 3876 | Itcl_BiInfoTypeMethodsCmd( |
3868 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3877 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3869 | 3878 | Tcl_Interp *interp, /* current interpreter */ |
3870 | 3879 | int objc, /* number of arguments */ |
3871 | 3880 | Tcl_Obj *const objv[]) /* argument objects */ |
3970 | 3979 | /* ARGSUSED */ |
3971 | 3980 | static int |
3972 | 3981 | Itcl_BiInfoTypeVarsCmd( |
3973 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
3982 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
3974 | 3983 | Tcl_Interp *interp, /* current interpreter */ |
3975 | 3984 | int objc, /* number of arguments */ |
3976 | 3985 | Tcl_Obj *const objv[]) /* argument objects */ |
4027 | 4036 | /* ARGSUSED */ |
4028 | 4037 | static int |
4029 | 4038 | Itcl_BiInfoTypeVariableCmd( |
4030 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4039 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4031 | 4040 | Tcl_Interp *interp, /* current interpreter */ |
4032 | 4041 | int objc, /* number of arguments */ |
4033 | 4042 | Tcl_Obj *const objv[]) /* argument objects */ |
4277 | 4286 | /* ARGSUSED */ |
4278 | 4287 | static int |
4279 | 4288 | Itcl_BiInfoVariablesCmd( |
4280 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4289 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4281 | 4290 | Tcl_Interp *interp, /* current interpreter */ |
4282 | 4291 | int objc, /* number of arguments */ |
4283 | 4292 | Tcl_Obj *const objv[]) /* argument objects */ |
4302 | 4311 | /* ARGSUSED */ |
4303 | 4312 | static int |
4304 | 4313 | Itcl_BiInfoWidgetadaptorCmd( |
4305 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4314 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4306 | 4315 | Tcl_Interp *interp, /* current interpreter */ |
4307 | 4316 | int objc, /* number of arguments */ |
4308 | 4317 | Tcl_Obj *const objv[]) /* argument objects */ |
4458 | 4467 | /* ARGSUSED */ |
4459 | 4468 | static int |
4460 | 4469 | Itcl_BiInfoDelegatedOptionsCmd( |
4461 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4470 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4462 | 4471 | Tcl_Interp *interp, /* current interpreter */ |
4463 | 4472 | int objc, /* number of arguments */ |
4464 | 4473 | Tcl_Obj *const objv[]) /* argument objects */ |
4529 | 4538 | /* ARGSUSED */ |
4530 | 4539 | static int |
4531 | 4540 | Itcl_BiInfoDelegatedMethodsCmd( |
4532 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4541 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4533 | 4542 | Tcl_Interp *interp, /* current interpreter */ |
4534 | 4543 | int objc, /* number of arguments */ |
4535 | 4544 | Tcl_Obj *const objv[]) /* argument objects */ |
4602 | 4611 | /* ARGSUSED */ |
4603 | 4612 | static int |
4604 | 4613 | Itcl_BiInfoDelegatedTypeMethodsCmd( |
4605 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4614 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4606 | 4615 | Tcl_Interp *interp, /* current interpreter */ |
4607 | 4616 | int objc, /* number of arguments */ |
4608 | 4617 | Tcl_Obj *const objv[]) /* argument objects */ |
4706 | 4715 | /* ARGSUSED */ |
4707 | 4716 | static int |
4708 | 4717 | Itcl_BiInfoDelegatedOptionCmd( |
4709 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4718 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4710 | 4719 | Tcl_Interp *interp, /* current interpreter */ |
4711 | 4720 | int objc, /* number of arguments */ |
4712 | 4721 | Tcl_Obj *const objv[]) /* argument objects */ |
4940 | 4949 | /* ARGSUSED */ |
4941 | 4950 | static int |
4942 | 4951 | Itcl_BiInfoDelegatedMethodCmd( |
4943 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
4952 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
4944 | 4953 | Tcl_Interp *interp, /* current interpreter */ |
4945 | 4954 | int objc, /* number of arguments */ |
4946 | 4955 | Tcl_Obj *const objv[]) /* argument objects */ |
5164 | 5173 | /* ARGSUSED */ |
5165 | 5174 | static int |
5166 | 5175 | Itcl_BiInfoDelegatedTypeMethodCmd( |
5167 | ClientData clientData, /* ItclObjectInfo Ptr */ | |
5176 | TCL_UNUSED(ClientData), /* ItclObjectInfo Ptr */ | |
5168 | 5177 | Tcl_Interp *interp, /* current interpreter */ |
5169 | 5178 | int objc, /* number of arguments */ |
5170 | 5179 | Tcl_Obj *const objv[]) /* argument objects */ |
56 | 56 | # if _MSC_VER >= 1400 |
57 | 57 | # pragma warning(disable:4267) |
58 | 58 | # pragma warning(disable:4996) |
59 | # endif | |
60 | #endif | |
61 | ||
62 | #ifndef JOIN | |
63 | # define JOIN(a,b) JOIN1(a,b) | |
64 | # define JOIN1(a,b) a##b | |
65 | #endif | |
66 | ||
67 | #ifndef TCL_UNUSED | |
68 | # if defined(__cplusplus) | |
69 | # define TCL_UNUSED(T) T | |
70 | # else | |
71 | # define TCL_UNUSED(T) T JOIN(dummy, __LINE__) | |
59 | 72 | # endif |
60 | 73 | #endif |
61 | 74 | |
652 | 665 | MODULE_SCOPE void ItclShowArgs(int level, const char *str, int objc, |
653 | 666 | Tcl_Obj * const* objv); |
654 | 667 | #else |
655 | #define ItclShowArgs(a,b,c,d) | |
668 | #define ItclShowArgs(a,b,c,d) do {(void)(c);(void)(d);} while(0) | |
656 | 669 | #endif |
657 | 670 | |
658 | 671 | MODULE_SCOPE Tcl_ObjCmdProc ItclCallCCommand; |
718 | 731 | MODULE_SCOPE int ItclCreateMethodVariable(Tcl_Interp *interp, |
719 | 732 | ItclVariable *ivPtr, Tcl_Obj* defaultPtr, Tcl_Obj* callbackPtr, |
720 | 733 | ItclMethodVariable** imvPtrPtr); |
721 | MODULE_SCOPE int Itcl_CreateMethodVariable (Tcl_Interp *interp, | |
722 | ItclClass *iclsPtr, Tcl_Obj *name, Tcl_Obj *defaultPtr, | |
723 | Tcl_Obj *callbackPtr, ItclMethodVariable **imvPtr); | |
724 | 734 | MODULE_SCOPE int DelegationInstall(Tcl_Interp *interp, ItclObject *ioPtr, |
725 | 735 | ItclClass *iclsPtr); |
726 | 736 | MODULE_SCOPE ItclClass *ItclNamespace2Class(Tcl_Namespace *nsPtr); |
302 | 302 | static void |
303 | 303 | ItclFreeC( |
304 | 304 | ClientData clientData, /* associated data */ |
305 | Tcl_Interp *interp) /* intepreter being deleted */ | |
305 | TCL_UNUSED(Tcl_Interp *)) /* interpreter being deleted */ | |
306 | 306 | { |
307 | 307 | Tcl_HashTable *tablePtr = (Tcl_HashTable*)clientData; |
308 | 308 | Tcl_HashSearch place; |
63 | 63 | */ |
64 | 64 | static int |
65 | 65 | NRBodyCmd( |
66 | ClientData clientData, /* */ | |
66 | TCL_UNUSED(ClientData), /* */ | |
67 | 67 | Tcl_Interp *interp, /* current interpreter */ |
68 | 68 | int objc, /* number of arguments */ |
69 | 69 | Tcl_Obj *const *objv) /* argument objects */ |
188 | 188 | /* ARGSUSED */ |
189 | 189 | static int |
190 | 190 | NRConfigBodyCmd( |
191 | ClientData dummy, /* unused */ | |
191 | TCL_UNUSED(ClientData), /* unused */ | |
192 | 192 | Tcl_Interp *interp, /* current interpreter */ |
193 | 193 | int objc, /* number of arguments */ |
194 | 194 | Tcl_Obj *const objv[]) /* argument objects */ |
1318 | 1318 | |
1319 | 1319 | static int |
1320 | 1320 | EquivArgLists( |
1321 | Tcl_Interp *interp, | |
1321 | TCL_UNUSED(Tcl_Interp*), | |
1322 | 1322 | ItclArgList *origArgs, |
1323 | 1323 | ItclArgList *realArgs) |
1324 | 1324 | { |
2055 | 2055 | */ |
2056 | 2056 | int |
2057 | 2057 | Itcl_ReportFuncErrors( |
2058 | Tcl_Interp* interp, /* interpreter being modified */ | |
2059 | ItclMemberFunc *imPtr, /* command member that was invoked */ | |
2060 | ItclObject *contextObj, /* object context for this command */ | |
2061 | int result) /* integer status code from proc body */ | |
2058 | TCL_UNUSED(Tcl_Interp*), /* interpreter being modified */ | |
2059 | TCL_UNUSED(ItclMemberFunc*), /* command member that was invoked */ | |
2060 | TCL_UNUSED(ItclObject*), /* object context for this command */ | |
2061 | int result) /* integer status code from proc body */ | |
2062 | 2062 | { |
2063 | 2063 | /* FIXME !!! */ |
2064 | 2064 | /* adapt to use of ItclProcErrorProc for stubs compatibility !! */ |
2188 | 2188 | */ |
2189 | 2189 | Tcl_Var |
2190 | 2190 | Itcl_VarAliasProc( |
2191 | Tcl_Interp *interp, | |
2191 | TCL_UNUSED(Tcl_Interp*), | |
2192 | 2192 | Tcl_Namespace *nsPtr, |
2193 | 2193 | const char *varName, |
2194 | 2194 | ClientData clientData) |
2265 | 2265 | ItclCheckCallProc( |
2266 | 2266 | ClientData clientData, |
2267 | 2267 | Tcl_Interp *interp, |
2268 | Tcl_ObjectContext contextPtr, | |
2269 | Tcl_CallFrame *framePtr, | |
2268 | TCL_UNUSED(Tcl_ObjectContext), | |
2269 | TCL_UNUSED(Tcl_CallFrame*), | |
2270 | 2270 | int *isFinished) |
2271 | 2271 | { |
2272 | 2272 | int result; |
2455 | 2455 | Itcl_PushStack(framePtr, stackPtr); |
2456 | 2456 | |
2457 | 2457 | if (ioPtr != NULL) { |
2458 | ioPtr->callRefCount++; | |
2459 | Itcl_PreserveData(ioPtr); | |
2458 | ioPtr->callRefCount++; | |
2459 | Itcl_PreserveData(ioPtr); /* ++ preserve until ItclAfterCallMethod releases it */ | |
2460 | 2460 | } |
2461 | 2461 | imPtr->iclsPtr->callRefCount++; |
2462 | 2462 | if (!imPtr->iclsPtr->infoPtr->useOldResolvers) { |
2485 | 2485 | ClientData clientData, |
2486 | 2486 | Tcl_Interp *interp, |
2487 | 2487 | Tcl_ObjectContext contextPtr, |
2488 | Tcl_Namespace *nsPtr, | |
2488 | TCL_UNUSED(Tcl_Namespace*), | |
2489 | 2489 | int call_result) |
2490 | 2490 | { |
2491 | 2491 | Tcl_HashEntry *hPtr; |
2570 | 2570 | if (hPtr == NULL) { |
2571 | 2571 | ckfree((char *)callContextPtr); |
2572 | 2572 | } |
2573 | Itcl_ReleaseData(ioPtr); | |
2574 | 2573 | } else { |
2575 | 2574 | ckfree((char *)callContextPtr); |
2576 | 2575 | } |
2576 | } | |
2577 | ||
2578 | if (ioPtr != NULL) { | |
2579 | Itcl_ReleaseData(ioPtr); /* -- paired release for preserve in ItclCheckCallMethod */ | |
2577 | 2580 | } |
2578 | 2581 | result = call_result; |
2579 | 2582 | finishReturn: |
2584 | 2587 | void |
2585 | 2588 | ItclProcErrorProc( |
2586 | 2589 | Tcl_Interp *interp, |
2587 | Tcl_Obj *procNameObj) | |
2590 | TCL_UNUSED(Tcl_Obj*)) | |
2588 | 2591 | { |
2589 | 2592 | Tcl_Obj *objPtr; |
2590 | 2593 | Tcl_HashEntry *hPtr; |
25 | 25 | CallFrame *framePtr = ((Interp *)interp)->framePtr; |
26 | 26 | if (framePtr != NULL) { |
27 | 27 | #ifdef ITCL_USE_MODIFIED_TCL_H |
28 | framePtr->isProcCallFrame |= FRAME_HAS_RESOLVER; | |
28 | framePtr->isProcCallFrame |= FRAME_HAS_RESOLVER; | |
29 | 29 | framePtr->resolvePtr = resolvePtr; |
30 | #elif defined(__cplusplus) | |
31 | (void)resolvePtr; | |
30 | 32 | #endif |
31 | return TCL_OK; | |
33 | return TCL_OK; | |
32 | 34 | } |
33 | 35 | return TCL_ERROR; |
34 | 36 | } |
43 | 45 | } |
44 | 46 | #ifdef ITCL_USE_MODIFIED_TCL_H |
45 | 47 | ((Namespace *)nsPtr)->resolvePtr = resolvePtr; |
48 | #elif defined(__cplusplus) | |
49 | (void)resolvePtr; | |
46 | 50 | #endif |
47 | 51 | return TCL_OK; |
48 | 52 | } |
49 | 53 | |
50 | 54 | Tcl_Var |
51 | 55 | Tcl_NewNamespaceVar( |
52 | Tcl_Interp *interp, | |
56 | TCL_UNUSED(Tcl_Interp *), | |
53 | 57 | Tcl_Namespace *nsPtr, |
54 | 58 | const char *varName) |
55 | 59 | { |
108 | 108 | static void |
109 | 109 | ObjectRenamedTrace( |
110 | 110 | ClientData clientData, /* The object being deleted. */ |
111 | Tcl_Interp *interp, /* The interpreter containing the object. */ | |
111 | Tcl_Interp *dummy, /* The interpreter containing the object. */ | |
112 | 112 | const char *oldName, /* What the object was (last) called. */ |
113 | 113 | const char *newName, /* Always NULL ??. not for itk!! */ |
114 | 114 | int flags) /* Why was the object deleted? */ |
115 | 115 | { |
116 | 116 | ItclObject *ioPtr = (ItclObject *)clientData; |
117 | 117 | Itcl_InterpState istate; |
118 | (void)dummy; | |
119 | (void)oldName; | |
120 | (void)flags; | |
118 | 121 | |
119 | 122 | if (newName != NULL) { |
120 | 123 | /* FIXME should enter the new name in the hashtables for objects etc. */ |
732 | 735 | ItclClass *iclsPtr, |
733 | 736 | const char *name) |
734 | 737 | { |
738 | (void)interp; | |
739 | (void)ioPtr; | |
740 | (void)iclsPtr; | |
741 | (void)name; | |
742 | ||
735 | 743 | return TCL_OK; |
736 | 744 | } |
737 | 745 | |
1149 | 1157 | */ |
1150 | 1158 | int |
1151 | 1159 | ItclInitObjectMethodVariables( |
1152 | Tcl_Interp *interp, | |
1160 | Tcl_Interp *dummy, | |
1153 | 1161 | ItclObject *ioPtr, |
1154 | 1162 | ItclClass *iclsPtr, |
1155 | 1163 | const char *name) |
1161 | 1169 | Tcl_HashEntry *hPtr2; |
1162 | 1170 | Tcl_HashSearch place; |
1163 | 1171 | int isNew; |
1172 | (void)dummy; | |
1173 | (void)name; | |
1164 | 1174 | |
1165 | 1175 | imvPtr = NULL; |
1166 | 1176 | Itcl_InitHierIter(&hier, iclsPtr); |
1939 | 1949 | char *name; |
1940 | 1950 | int ignore; |
1941 | 1951 | int cmp; |
1952 | (void)callerNsPtr; | |
1942 | 1953 | |
1943 | 1954 | if (contextIoPtr == NULL) { |
1944 | 1955 | resultPtr = Tcl_GetObjResult(interp); |
2080 | 2091 | ItclObject *contextIoPtr = (ItclObject*)cdata; |
2081 | 2092 | Tcl_Obj *objPtr; |
2082 | 2093 | const char *objName; |
2094 | (void)name2; | |
2083 | 2095 | |
2084 | 2096 | /* because of SF bug #187 use a different trace handler for "this", "win", "type" |
2085 | 2097 | * *self" and "selfns" |
2140 | 2152 | const char *objName; |
2141 | 2153 | const char *head; |
2142 | 2154 | const char *tail; |
2155 | (void)name2; | |
2143 | 2156 | |
2144 | 2157 | /* |
2145 | 2158 | * Handle read traces on "win" |
2197 | 2210 | ItclObject *contextIoPtr = (ItclObject*)cdata; |
2198 | 2211 | Tcl_Obj *objPtr; |
2199 | 2212 | const char *objName; |
2213 | (void)name2; | |
2200 | 2214 | |
2201 | 2215 | /* |
2202 | 2216 | * Handle read traces on "type" |
2248 | 2262 | ItclObject *contextIoPtr = (ItclObject*)cdata; |
2249 | 2263 | Tcl_Obj *objPtr; |
2250 | 2264 | const char *objName; |
2265 | (void)name2; | |
2251 | 2266 | |
2252 | 2267 | /* |
2253 | 2268 | * Handle read traces on "self" |
2315 | 2330 | ItclObject *contextIoPtr = (ItclObject*)cdata; |
2316 | 2331 | Tcl_Obj *objPtr; |
2317 | 2332 | const char *objName; |
2333 | (void)name2; | |
2318 | 2334 | |
2319 | 2335 | /* |
2320 | 2336 | * Handle read traces on "selfns" |
2362 | 2378 | { |
2363 | 2379 | ItclObject *ioPtr; |
2364 | 2380 | ItclOption *ioptPtr; |
2381 | (void)interp; | |
2382 | (void)name1; | |
2383 | (void)name2; | |
2365 | 2384 | |
2366 | 2385 | /* FIXME !!! */ |
2367 | 2386 | /* don't know yet if ItclTraceOptionVar is really needed !! */ |
2418 | 2437 | ItclComponent *icPtr; |
2419 | 2438 | ItclDelegatedFunction *idmPtr; |
2420 | 2439 | const char *val; |
2440 | (void)name2; | |
2421 | 2441 | |
2422 | 2442 | /* FIXME should free memory on unset or rename!! */ |
2423 | 2443 | if (cdata != NULL) { |
2515 | 2535 | ItclObjectInfo *infoPtr; |
2516 | 2536 | ItclObject *ioPtr; |
2517 | 2537 | ItclVariable *ivPtr; |
2538 | (void)name2; | |
2518 | 2539 | |
2519 | 2540 | /* FIXME !!! */ |
2520 | 2541 | /* FIXME should free memory on unset or rename!! */ |
3310 | 3331 | } |
3311 | 3332 | break; |
3312 | 3333 | } else { |
3313 | /* fall through */ | |
3314 | 3334 | } |
3335 | /* FALLTHRU */ | |
3315 | 3336 | default: |
3316 | 3337 | { |
3317 | 3338 | char buf[2]; |
3436 | 3457 | |
3437 | 3458 | int |
3438 | 3459 | DelegatedOptionsInstall( |
3439 | Tcl_Interp *interp, | |
3460 | Tcl_Interp *dummy, | |
3440 | 3461 | ItclClass *iclsPtr) |
3441 | 3462 | { |
3442 | 3463 | Tcl_HashEntry *hPtr2; |
3445 | 3466 | ItclOption *ioptPtr; |
3446 | 3467 | FOREACH_HASH_DECLS; |
3447 | 3468 | char *optionName; |
3469 | (void)dummy; | |
3448 | 3470 | |
3449 | 3471 | FOREACH_HASH_VALUE(idoPtr, &iclsPtr->delegatedOptions) { |
3450 | 3472 | optionName = Tcl_GetString(idoPtr->namePtr); |
651 | 651 | |
652 | 652 | static int |
653 | 653 | CloneProc( |
654 | Tcl_Interp *interp, | |
654 | Tcl_Interp *dummy, | |
655 | 655 | ClientData original, |
656 | 656 | ClientData *copyPtr) |
657 | 657 | { |
658 | (void)dummy; | |
659 | ||
658 | 660 | Itcl_PreserveData((ItclMemberFunc *)original); |
659 | 661 | *copyPtr = original; |
660 | 662 | return TCL_OK; |
667 | 669 | int result) |
668 | 670 | { |
669 | 671 | ClientData clientData = data[0]; |
672 | ||
670 | 673 | Tcl_ObjectContext context = (Tcl_ObjectContext)data[1]; |
671 | 674 | |
672 | 675 | return ItclAfterCallMethod(clientData, interp, context, NULL, result); |
705 | 708 | int objc, |
706 | 709 | Tcl_Obj *const *objv) |
707 | 710 | { |
711 | (void)clientData; | |
712 | (void)interp; | |
713 | (void)context; | |
714 | (void)objc; | |
715 | (void)objv; | |
716 | ||
708 | 717 | return TCL_ERROR; |
709 | 718 | } |
710 | 719 | |
2475 | 2484 | int objc, /* number of arguments */ |
2476 | 2485 | Tcl_Obj *const objv[]) /* argument objects */ |
2477 | 2486 | { |
2487 | (void)clientData; | |
2488 | (void)interp; | |
2489 | ||
2478 | 2490 | ItclShowArgs(0, "Itcl_ClassMixinCmd", objc, objv); |
2479 | 2491 | return TCL_OK; |
2480 | 2492 | } |
2593 | 2605 | int result; |
2594 | 2606 | int i; |
2595 | 2607 | const char *cp; |
2608 | (void)infoPtr; | |
2596 | 2609 | |
2597 | 2610 | ItclShowArgs(1, "ItclParseOption", objc, objv); |
2598 | 2611 | pLevel = Itcl_Protection(interp, 0); |
3049 | 3062 | " Only these can have components", NULL); |
3050 | 3063 | return TCL_ERROR; |
3051 | 3064 | } |
3052 | if ((objc < 2) && (objc > 6)) { | |
3065 | if ((objc < 2) || (objc > 6)) { | |
3053 | 3066 | Tcl_AppendResult(interp, "wrong # args should be: ", usage, NULL); |
3054 | 3067 | return TCL_ERROR; |
3055 | 3068 | } |
648 | 648 | |
649 | 649 | Tcl_HashEntry *hPtr; |
650 | 650 | ItclVarLookup *vlookup; |
651 | (void)flags; | |
651 | 652 | |
652 | 653 | /* |
653 | 654 | * See if the requested variable is a recognized "common" member. |
61 | 61 | */ |
62 | 62 | int |
63 | 63 | Itcl_StubCreateCmd( |
64 | ClientData clientData, /* not used */ | |
64 | TCL_UNUSED(ClientData), /* not used */ | |
65 | 65 | Tcl_Interp *interp, /* current interpreter */ |
66 | 66 | int objc, /* number of arguments */ |
67 | 67 | Tcl_Obj *const objv[]) /* argument objects */ |
111 | 111 | */ |
112 | 112 | int |
113 | 113 | Itcl_StubExistsCmd( |
114 | ClientData clientData, /* not used */ | |
114 | TCL_UNUSED(ClientData), /* not used */ | |
115 | 115 | Tcl_Interp *interp, /* current interpreter */ |
116 | 116 | int objc, /* number of arguments */ |
117 | 117 | Tcl_Obj *const objv[]) /* argument objects */ |
223 | 223 | /* ARGSUSED */ |
224 | 224 | static void |
225 | 225 | ItclDeleteStub( |
226 | ClientData cdata) /* not used */ | |
226 | TCL_UNUSED(ClientData)) /* not used */ | |
227 | 227 | { |
228 | 228 | /* do nothing */ |
229 | 229 | } |
125 | 125 | Tcl_Interp *interp, |
126 | 126 | int numRemoved, |
127 | 127 | int numInserted, |
128 | int objc, | |
128 | TCL_UNUSED(int) /* objc */, | |
129 | 129 | Tcl_Obj *const *objv) |
130 | 130 | { |
131 | 131 | return TclInitRewriteEnsemble(interp, numRemoved, numInserted, objv); |
627 | 627 | /* Free cdata now */ |
628 | 628 | freeProc = blk->freeProc; |
629 | 629 | blk->freeProc = NULL; |
630 | freeProc(cdata); | |
630 | freeProc((char *)cdata); | |
631 | 631 | } |
632 | 632 | |
633 | 633 | /* |
673 | 673 | */ |
674 | 674 | void Itcl_Free(void *ptr) { |
675 | 675 | PresMemoryPrefix *blk; |
676 | ||
676 | ||
677 | 677 | if (ptr == NULL) { |
678 | 678 | return; |
679 | 679 | } |
0 | 0 | # Tcl package index file, version 1.0 |
1 | 1 | # |
2 | 2 | # Do NOT try this command |
3 | # | |
3 | # | |
4 | 4 | # if {![package vsatisfies [package provide Tcl] 8.6-]} {return} |
5 | 5 | # |
6 | 6 | # as a way to accept working with all of Tcl 8.6, Tcl 8.X, X>6, and |
16 | 16 | |
17 | 17 | if {![package vsatisfies [package provide Tcl] 8.6]} {return} |
18 | 18 | |
19 | package ifneeded itcl @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] itcl] | |
20 | package ifneeded Itcl @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] itcl] | |
19 | package ifneeded itcl @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] Itcl] | |
20 | package ifneeded Itcl @PACKAGE_VERSION@ [list load [file join $dir "@PKG_LIB_FILE@"] Itcl] |
2 | 2 | |
3 | 3 | http://www.tcl.tk/doc/tea/ |
4 | 4 | |
5 | This package is part of the Tcl project at SourceForge, and latest | |
6 | sources should be available there: | |
5 | This package is part of the Tcl project at SourceForge, but sources | |
6 | and bug/patch database are hosted on fossil here: | |
7 | 7 | |
8 | http://tcl.sourceforge.net/ | |
8 | https://core.tcl-lang.org/tclconfig | |
9 | 9 | |
10 | 10 | This package is a freely available open source package. You can do |
11 | 11 | virtually anything you like with it, such as modifying it, redistributing |
0 | 0 | #!/bin/sh |
1 | 1 | # install - install a program, script, or datafile |
2 | 2 | |
3 | scriptversion=2011-04-20.01; # UTC | |
3 | scriptversion=2020-07-26.22; # UTC | |
4 | 4 | |
5 | 5 | # This originates from X11R5 (mit/util/scripts/install.sh), which was |
6 | 6 | # later released in X11R6 (xc/config/util/install.sh) with the |
34 | 34 | # FSF changes to this file are in the public domain. |
35 | 35 | # |
36 | 36 | # Calling this script install-sh is preferred over install.sh, to prevent |
37 | # `make' implicit rules from creating a file called install from it | |
37 | # 'make' implicit rules from creating a file called install from it | |
38 | 38 | # when there is no Makefile. |
39 | 39 | # |
40 | 40 | # This script is compatible with the BSD install script, but was written |
41 | 41 | # from scratch. |
42 | 42 | |
43 | tab=' ' | |
43 | 44 | nl=' |
44 | 45 | ' |
45 | IFS=" "" $nl" | |
46 | ||
47 | # set DOITPROG to echo to test this script | |
48 | ||
49 | # Don't use :- since 4.3BSD and earlier shells don't like it. | |
46 | IFS=" $tab$nl" | |
47 | ||
48 | # Set DOITPROG to "echo" to test this script. | |
49 | ||
50 | 50 | doit=${DOITPROG-} |
51 | if test -z "$doit"; then | |
52 | doit_exec=exec | |
53 | else | |
54 | doit_exec=$doit | |
55 | fi | |
51 | doit_exec=${doit:-exec} | |
56 | 52 | |
57 | 53 | # Put in absolute file names if you don't have them in your path; |
58 | 54 | # or use environment vars. |
67 | 63 | rmprog=${RMPROG-rm} |
68 | 64 | stripprog=${STRIPPROG-strip} |
69 | 65 | |
70 | posix_glob='?' | |
71 | initialize_posix_glob=' | |
72 | test "$posix_glob" != "?" || { | |
73 | if (set -f) 2>/dev/null; then | |
74 | posix_glob= | |
75 | else | |
76 | posix_glob=: | |
77 | fi | |
78 | } | |
79 | ' | |
80 | ||
81 | 66 | posix_mkdir= |
82 | 67 | |
83 | 68 | # Desired mode of installed file. |
84 | 69 | mode=0755 |
70 | ||
71 | # Create dirs (including intermediate dirs) using mode 755. | |
72 | # This is like GNU 'install' as of coreutils 8.32 (2020). | |
73 | mkdir_umask=22 | |
85 | 74 | |
86 | 75 | chgrpcmd= |
87 | 76 | chmodcmd=$chmodprog |
96 | 85 | dst_arg= |
97 | 86 | |
98 | 87 | copy_on_change=false |
99 | no_target_directory= | |
88 | is_target_a_directory=possibly | |
100 | 89 | |
101 | 90 | usage="\ |
102 | 91 | Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE |
119 | 108 | -m MODE $chmodprog installed files to MODE. |
120 | 109 | -o USER $chownprog installed files to USER. |
121 | 110 | -s $stripprog installed files. |
122 | -S $stripprog installed files. | |
111 | -S OPTION $stripprog installed files using OPTION. | |
123 | 112 | -t DIRECTORY install into DIRECTORY. |
124 | 113 | -T report an error if DSTFILE is a directory. |
125 | 114 | |
137 | 126 | -d) dir_arg=true;; |
138 | 127 | |
139 | 128 | -g) chgrpcmd="$chgrpprog $2" |
140 | shift;; | |
129 | shift;; | |
141 | 130 | |
142 | 131 | --help) echo "$usage"; exit $?;; |
143 | 132 | |
144 | 133 | -m) mode=$2 |
145 | case $mode in | |
146 | *' '* | *' '* | *' | |
147 | '* | *'*'* | *'?'* | *'['*) | |
148 | echo "$0: invalid mode: $mode" >&2 | |
149 | exit 1;; | |
150 | esac | |
151 | shift;; | |
134 | case $mode in | |
135 | *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) | |
136 | echo "$0: invalid mode: $mode" >&2 | |
137 | exit 1;; | |
138 | esac | |
139 | shift;; | |
152 | 140 | |
153 | 141 | -o) chowncmd="$chownprog $2" |
154 | shift;; | |
142 | shift;; | |
155 | 143 | |
156 | 144 | -s) stripcmd=$stripprog;; |
157 | 145 | |
158 | 146 | -S) stripcmd="$stripprog $2" |
159 | shift;; | |
160 | ||
161 | -t) dst_arg=$2 | |
162 | shift;; | |
163 | ||
164 | -T) no_target_directory=true;; | |
147 | shift;; | |
148 | ||
149 | -t) | |
150 | is_target_a_directory=always | |
151 | dst_arg=$2 | |
152 | # Protect names problematic for 'test' and other utilities. | |
153 | case $dst_arg in | |
154 | -* | [=\(\)!]) dst_arg=./$dst_arg;; | |
155 | esac | |
156 | shift;; | |
157 | ||
158 | -T) is_target_a_directory=never;; | |
165 | 159 | |
166 | 160 | --version) echo "$0 $scriptversion"; exit $?;; |
167 | 161 | |
168 | --) shift | |
169 | break;; | |
170 | ||
171 | -*) echo "$0: invalid option: $1" >&2 | |
172 | exit 1;; | |
162 | --) shift | |
163 | break;; | |
164 | ||
165 | -*) echo "$0: invalid option: $1" >&2 | |
166 | exit 1;; | |
173 | 167 | |
174 | 168 | *) break;; |
175 | 169 | esac |
176 | 170 | shift |
177 | 171 | done |
172 | ||
173 | # We allow the use of options -d and -T together, by making -d | |
174 | # take the precedence; this is for compatibility with GNU install. | |
175 | ||
176 | if test -n "$dir_arg"; then | |
177 | if test -n "$dst_arg"; then | |
178 | echo "$0: target directory not allowed when installing a directory." >&2 | |
179 | exit 1 | |
180 | fi | |
181 | fi | |
178 | 182 | |
179 | 183 | if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then |
180 | 184 | # When -d is used, all remaining arguments are directories to create. |
189 | 193 | fi |
190 | 194 | shift # arg |
191 | 195 | dst_arg=$arg |
196 | # Protect names problematic for 'test' and other utilities. | |
197 | case $dst_arg in | |
198 | -* | [=\(\)!]) dst_arg=./$dst_arg;; | |
199 | esac | |
192 | 200 | done |
193 | 201 | fi |
194 | 202 | |
197 | 205 | echo "$0: no input file specified." >&2 |
198 | 206 | exit 1 |
199 | 207 | fi |
200 | # It's OK to call `install-sh -d' without argument. | |
208 | # It's OK to call 'install-sh -d' without argument. | |
201 | 209 | # This can happen when creating conditional directories. |
202 | 210 | exit 0 |
211 | fi | |
212 | ||
213 | if test -z "$dir_arg"; then | |
214 | if test $# -gt 1 || test "$is_target_a_directory" = always; then | |
215 | if test ! -d "$dst_arg"; then | |
216 | echo "$0: $dst_arg: Is not a directory." >&2 | |
217 | exit 1 | |
218 | fi | |
219 | fi | |
203 | 220 | fi |
204 | 221 | |
205 | 222 | if test -z "$dir_arg"; then |
218 | 235 | |
219 | 236 | *[0-7]) |
220 | 237 | if test -z "$stripcmd"; then |
221 | u_plus_rw= | |
238 | u_plus_rw= | |
222 | 239 | else |
223 | u_plus_rw='% 200' | |
240 | u_plus_rw='% 200' | |
224 | 241 | fi |
225 | 242 | cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; |
226 | 243 | *) |
227 | 244 | if test -z "$stripcmd"; then |
228 | u_plus_rw= | |
245 | u_plus_rw= | |
229 | 246 | else |
230 | u_plus_rw=,u+rw | |
247 | u_plus_rw=,u+rw | |
231 | 248 | fi |
232 | 249 | cp_umask=$mode$u_plus_rw;; |
233 | 250 | esac |
235 | 252 | |
236 | 253 | for src |
237 | 254 | do |
238 | # Protect names starting with `-'. | |
255 | # Protect names problematic for 'test' and other utilities. | |
239 | 256 | case $src in |
240 | -*) src=./$src;; | |
257 | -* | [=\(\)!]) src=./$src;; | |
241 | 258 | esac |
242 | 259 | |
243 | 260 | if test -n "$dir_arg"; then |
259 | 276 | echo "$0: no destination specified." >&2 |
260 | 277 | exit 1 |
261 | 278 | fi |
262 | ||
263 | 279 | dst=$dst_arg |
264 | # Protect names starting with `-'. | |
265 | case $dst in | |
266 | -*) dst=./$dst;; | |
267 | esac | |
268 | ||
269 | # If destination is a directory, append the input filename; won't work | |
270 | # if double slashes aren't ignored. | |
280 | ||
281 | # If destination is a directory, append the input filename. | |
271 | 282 | if test -d "$dst"; then |
272 | if test -n "$no_target_directory"; then | |
273 | echo "$0: $dst_arg: Is a directory" >&2 | |
274 | exit 1 | |
283 | if test "$is_target_a_directory" = never; then | |
284 | echo "$0: $dst_arg: Is a directory" >&2 | |
285 | exit 1 | |
275 | 286 | fi |
276 | 287 | dstdir=$dst |
277 | dst=$dstdir/`basename "$src"` | |
288 | dstbase=`basename "$src"` | |
289 | case $dst in | |
290 | */) dst=$dst$dstbase;; | |
291 | *) dst=$dst/$dstbase;; | |
292 | esac | |
278 | 293 | dstdir_status=0 |
279 | 294 | else |
280 | # Prefer dirname, but fall back on a substitute if dirname fails. | |
281 | dstdir=` | |
282 | (dirname "$dst") 2>/dev/null || | |
283 | expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ | |
284 | X"$dst" : 'X\(//\)[^/]' \| \ | |
285 | X"$dst" : 'X\(//\)$' \| \ | |
286 | X"$dst" : 'X\(/\)' \| . 2>/dev/null || | |
287 | echo X"$dst" | | |
288 | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ | |
289 | s//\1/ | |
290 | q | |
291 | } | |
292 | /^X\(\/\/\)[^/].*/{ | |
293 | s//\1/ | |
294 | q | |
295 | } | |
296 | /^X\(\/\/\)$/{ | |
297 | s//\1/ | |
298 | q | |
299 | } | |
300 | /^X\(\/\).*/{ | |
301 | s//\1/ | |
302 | q | |
303 | } | |
304 | s/.*/./; q' | |
305 | ` | |
306 | ||
295 | dstdir=`dirname "$dst"` | |
307 | 296 | test -d "$dstdir" |
308 | 297 | dstdir_status=$? |
309 | 298 | fi |
310 | 299 | fi |
311 | 300 | |
301 | case $dstdir in | |
302 | */) dstdirslash=$dstdir;; | |
303 | *) dstdirslash=$dstdir/;; | |
304 | esac | |
305 | ||
312 | 306 | obsolete_mkdir_used=false |
313 | 307 | |
314 | 308 | if test $dstdir_status != 0; then |
315 | 309 | case $posix_mkdir in |
316 | 310 | '') |
317 | # Create intermediate dirs using mode 755 as modified by the umask. | |
318 | # This is like FreeBSD 'install' as of 1997-10-28. | |
319 | umask=`umask` | |
320 | case $stripcmd.$umask in | |
321 | # Optimize common cases. | |
322 | *[2367][2367]) mkdir_umask=$umask;; | |
323 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; | |
324 | ||
325 | *[0-7]) | |
326 | mkdir_umask=`expr $umask + 22 \ | |
327 | - $umask % 100 % 40 + $umask % 20 \ | |
328 | - $umask % 10 % 4 + $umask % 2 | |
329 | `;; | |
330 | *) mkdir_umask=$umask,go-w;; | |
331 | esac | |
332 | ||
333 | # With -d, create the new directory with the user-specified mode. | |
334 | # Otherwise, rely on $mkdir_umask. | |
335 | if test -n "$dir_arg"; then | |
336 | mkdir_mode=-m$mode | |
311 | # With -d, create the new directory with the user-specified mode. | |
312 | # Otherwise, rely on $mkdir_umask. | |
313 | if test -n "$dir_arg"; then | |
314 | mkdir_mode=-m$mode | |
315 | else | |
316 | mkdir_mode= | |
317 | fi | |
318 | ||
319 | posix_mkdir=false | |
320 | # The $RANDOM variable is not portable (e.g., dash). Use it | |
321 | # here however when possible just to lower collision chance. | |
322 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ | |
323 | ||
324 | trap ' | |
325 | ret=$? | |
326 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null | |
327 | exit $ret | |
328 | ' 0 | |
329 | ||
330 | # Because "mkdir -p" follows existing symlinks and we likely work | |
331 | # directly in world-writeable /tmp, make sure that the '$tmpdir' | |
332 | # directory is successfully created first before we actually test | |
333 | # 'mkdir -p'. | |
334 | if (umask $mkdir_umask && | |
335 | $mkdirprog $mkdir_mode "$tmpdir" && | |
336 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 | |
337 | then | |
338 | if test -z "$dir_arg" || { | |
339 | # Check for POSIX incompatibilities with -m. | |
340 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or | |
341 | # other-writable bit of parent directory when it shouldn't. | |
342 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. | |
343 | test_tmpdir="$tmpdir/a" | |
344 | ls_ld_tmpdir=`ls -ld "$test_tmpdir"` | |
345 | case $ls_ld_tmpdir in | |
346 | d????-?r-*) different_mode=700;; | |
347 | d????-?--*) different_mode=755;; | |
348 | *) false;; | |
349 | esac && | |
350 | $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { | |
351 | ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` | |
352 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" | |
353 | } | |
354 | } | |
355 | then posix_mkdir=: | |
356 | fi | |
357 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" | |
337 | 358 | else |
338 | mkdir_mode= | |
359 | # Remove any dirs left behind by ancient mkdir implementations. | |
360 | rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null | |
339 | 361 | fi |
340 | ||
341 | posix_mkdir=false | |
342 | case $umask in | |
343 | *[123567][0-7][0-7]) | |
344 | # POSIX mkdir -p sets u+wx bits regardless of umask, which | |
345 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. | |
346 | ;; | |
347 | *) | |
348 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ | |
349 | trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 | |
350 | ||
351 | if (umask $mkdir_umask && | |
352 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 | |
353 | then | |
354 | if test -z "$dir_arg" || { | |
355 | # Check for POSIX incompatibilities with -m. | |
356 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or | |
357 | # other-writeable bit of parent directory when it shouldn't. | |
358 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. | |
359 | ls_ld_tmpdir=`ls -ld "$tmpdir"` | |
360 | case $ls_ld_tmpdir in | |
361 | d????-?r-*) different_mode=700;; | |
362 | d????-?--*) different_mode=755;; | |
363 | *) false;; | |
364 | esac && | |
365 | $mkdirprog -m$different_mode -p -- "$tmpdir" && { | |
366 | ls_ld_tmpdir_1=`ls -ld "$tmpdir"` | |
367 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" | |
368 | } | |
369 | } | |
370 | then posix_mkdir=: | |
371 | fi | |
372 | rmdir "$tmpdir/d" "$tmpdir" | |
373 | else | |
374 | # Remove any dirs left behind by ancient mkdir implementations. | |
375 | rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null | |
376 | fi | |
377 | trap '' 0;; | |
378 | esac;; | |
362 | trap '' 0;; | |
379 | 363 | esac |
380 | 364 | |
381 | 365 | if |
382 | 366 | $posix_mkdir && ( |
383 | umask $mkdir_umask && | |
384 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" | |
367 | umask $mkdir_umask && | |
368 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" | |
385 | 369 | ) |
386 | 370 | then : |
387 | 371 | else |
388 | 372 | |
389 | # The umask is ridiculous, or mkdir does not conform to POSIX, | |
373 | # mkdir does not conform to POSIX, | |
390 | 374 | # or it failed possibly due to a race condition. Create the |
391 | 375 | # directory the slow way, step by step, checking for races as we go. |
392 | 376 | |
393 | 377 | case $dstdir in |
394 | /*) prefix='/';; | |
395 | -*) prefix='./';; | |
396 | *) prefix='';; | |
378 | /*) prefix='/';; | |
379 | [-=\(\)!]*) prefix='./';; | |
380 | *) prefix='';; | |
397 | 381 | esac |
398 | ||
399 | eval "$initialize_posix_glob" | |
400 | 382 | |
401 | 383 | oIFS=$IFS |
402 | 384 | IFS=/ |
403 | $posix_glob set -f | |
385 | set -f | |
404 | 386 | set fnord $dstdir |
405 | 387 | shift |
406 | $posix_glob set +f | |
388 | set +f | |
407 | 389 | IFS=$oIFS |
408 | 390 | |
409 | 391 | prefixes= |
410 | 392 | |
411 | 393 | for d |
412 | 394 | do |
413 | test -z "$d" && continue | |
414 | ||
415 | prefix=$prefix$d | |
416 | if test -d "$prefix"; then | |
417 | prefixes= | |
418 | else | |
419 | if $posix_mkdir; then | |
420 | (umask=$mkdir_umask && | |
421 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break | |
422 | # Don't fail if two instances are running concurrently. | |
423 | test -d "$prefix" || exit 1 | |
424 | else | |
425 | case $prefix in | |
426 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; | |
427 | *) qprefix=$prefix;; | |
428 | esac | |
429 | prefixes="$prefixes '$qprefix'" | |
430 | fi | |
431 | fi | |
432 | prefix=$prefix/ | |
395 | test X"$d" = X && continue | |
396 | ||
397 | prefix=$prefix$d | |
398 | if test -d "$prefix"; then | |
399 | prefixes= | |
400 | else | |
401 | if $posix_mkdir; then | |
402 | (umask $mkdir_umask && | |
403 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break | |
404 | # Don't fail if two instances are running concurrently. | |
405 | test -d "$prefix" || exit 1 | |
406 | else | |
407 | case $prefix in | |
408 | *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; | |
409 | *) qprefix=$prefix;; | |
410 | esac | |
411 | prefixes="$prefixes '$qprefix'" | |
412 | fi | |
413 | fi | |
414 | prefix=$prefix/ | |
433 | 415 | done |
434 | 416 | |
435 | 417 | if test -n "$prefixes"; then |
436 | # Don't fail if two instances are running concurrently. | |
437 | (umask $mkdir_umask && | |
438 | eval "\$doit_exec \$mkdirprog $prefixes") || | |
439 | test -d "$dstdir" || exit 1 | |
440 | obsolete_mkdir_used=true | |
418 | # Don't fail if two instances are running concurrently. | |
419 | (umask $mkdir_umask && | |
420 | eval "\$doit_exec \$mkdirprog $prefixes") || | |
421 | test -d "$dstdir" || exit 1 | |
422 | obsolete_mkdir_used=true | |
441 | 423 | fi |
442 | 424 | fi |
443 | 425 | fi |
450 | 432 | else |
451 | 433 | |
452 | 434 | # Make a couple of temp file names in the proper directory. |
453 | dsttmp=$dstdir/_inst.$$_ | |
454 | rmtmp=$dstdir/_rm.$$_ | |
435 | dsttmp=${dstdirslash}_inst.$$_ | |
436 | rmtmp=${dstdirslash}_rm.$$_ | |
455 | 437 | |
456 | 438 | # Trap to clean up those temp files at exit. |
457 | 439 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 |
458 | 440 | |
459 | 441 | # Copy the file name to the temp name. |
460 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && | |
442 | (umask $cp_umask && | |
443 | { test -z "$stripcmd" || { | |
444 | # Create $dsttmp read-write so that cp doesn't create it read-only, | |
445 | # which would cause strip to fail. | |
446 | if test -z "$doit"; then | |
447 | : >"$dsttmp" # No need to fork-exec 'touch'. | |
448 | else | |
449 | $doit touch "$dsttmp" | |
450 | fi | |
451 | } | |
452 | } && | |
453 | $doit_exec $cpprog "$src" "$dsttmp") && | |
461 | 454 | |
462 | 455 | # and set any options; do chmod last to preserve setuid bits. |
463 | 456 | # |
472 | 465 | |
473 | 466 | # If -C, don't bother to copy if it wouldn't change the file. |
474 | 467 | if $copy_on_change && |
475 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && | |
476 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && | |
477 | ||
478 | eval "$initialize_posix_glob" && | |
479 | $posix_glob set -f && | |
468 | old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && | |
469 | new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && | |
470 | set -f && | |
480 | 471 | set X $old && old=:$2:$4:$5:$6 && |
481 | 472 | set X $new && new=:$2:$4:$5:$6 && |
482 | $posix_glob set +f && | |
483 | ||
473 | set +f && | |
484 | 474 | test "$old" = "$new" && |
485 | 475 | $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 |
486 | 476 | then |
493 | 483 | # to itself, or perhaps because mv is so ancient that it does not |
494 | 484 | # support -f. |
495 | 485 | { |
496 | # Now remove or move aside any old file at destination location. | |
497 | # We try this two ways since rm can't unlink itself on some | |
498 | # systems and the destination file might be busy for other | |
499 | # reasons. In this case, the final cleanup might fail but the new | |
500 | # file should still install successfully. | |
501 | { | |
502 | test ! -f "$dst" || | |
503 | $doit $rmcmd -f "$dst" 2>/dev/null || | |
504 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && | |
505 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } | |
506 | } || | |
507 | { echo "$0: cannot unlink or rename $dst" >&2 | |
508 | (exit 1); exit 1 | |
509 | } | |
510 | } && | |
511 | ||
512 | # Now rename the file to the real destination. | |
513 | $doit $mvcmd "$dsttmp" "$dst" | |
486 | # Now remove or move aside any old file at destination location. | |
487 | # We try this two ways since rm can't unlink itself on some | |
488 | # systems and the destination file might be busy for other | |
489 | # reasons. In this case, the final cleanup might fail but the new | |
490 | # file should still install successfully. | |
491 | { | |
492 | test ! -f "$dst" || | |
493 | $doit $rmcmd -f "$dst" 2>/dev/null || | |
494 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && | |
495 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } | |
496 | } || | |
497 | { echo "$0: cannot unlink or rename $dst" >&2 | |
498 | (exit 1); exit 1 | |
499 | } | |
500 | } && | |
501 | ||
502 | # Now rename the file to the real destination. | |
503 | $doit $mvcmd "$dsttmp" "$dst" | |
514 | 504 | } |
515 | 505 | fi || exit 1 |
516 | 506 | |
519 | 509 | done |
520 | 510 | |
521 | 511 | # Local variables: |
522 | # eval: (add-hook 'write-file-hooks 'time-stamp) | |
512 | # eval: (add-hook 'before-save-hook 'time-stamp) | |
523 | 513 | # time-stamp-start: "scriptversion=" |
524 | 514 | # time-stamp-format: "%:y-%02m-%02d.%02H" |
525 | # time-stamp-time-zone: "UTC" | |
515 | # time-stamp-time-zone: "UTC0" | |
526 | 516 | # time-stamp-end: "; # UTC" |
527 | # End: | |
517 | # End:⏎ |
49 | 49 | # we reset no_tcl in case something fails here |
50 | 50 | no_tcl=true |
51 | 51 | AC_ARG_WITH(tcl, |
52 | AC_HELP_STRING([--with-tcl], | |
52 | AS_HELP_STRING([--with-tcl], | |
53 | 53 | [directory containing tcl configuration (tclConfig.sh)]), |
54 | with_tclconfig="${withval}") | |
54 | [with_tclconfig="${withval}"]) | |
55 | 55 | AC_MSG_CHECKING([for Tcl configuration]) |
56 | 56 | AC_CACHE_VAL(ac_cv_c_tclconfig,[ |
57 | 57 | |
211 | 211 | # we reset no_tk in case something fails here |
212 | 212 | no_tk=true |
213 | 213 | AC_ARG_WITH(tk, |
214 | AC_HELP_STRING([--with-tk], | |
214 | AS_HELP_STRING([--with-tk], | |
215 | 215 | [directory containing tk configuration (tkConfig.sh)]), |
216 | with_tkconfig="${withval}") | |
216 | [with_tkconfig="${withval}"]) | |
217 | 217 | AC_MSG_CHECKING([for Tk configuration]) |
218 | 218 | AC_CACHE_VAL(ac_cv_c_tkconfig,[ |
219 | 219 | |
265 | 265 | for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ |
266 | 266 | `ls -d /Library/Frameworks 2>/dev/null` \ |
267 | 267 | `ls -d /Network/Library/Frameworks 2>/dev/null` \ |
268 | `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/Tcl.framework 2>/dev/null` \ | |
269 | `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/Tcl.framework 2>/dev/null` \ | |
270 | `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework 2>/dev/null` \ | |
271 | 268 | ; do |
272 | 269 | if test -f "$i/Tk.framework/tkConfig.sh" ; then |
273 | 270 | ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" |
284 | 281 | `ls -d /usr/local/lib 2>/dev/null` \ |
285 | 282 | `ls -d /usr/contrib/lib 2>/dev/null` \ |
286 | 283 | `ls -d /usr/pkg/lib 2>/dev/null` \ |
284 | `ls -d /usr/lib/tk8.6 2>/dev/null` \ | |
285 | `ls -d /usr/lib/tk8.5 2>/dev/null` \ | |
287 | 286 | `ls -d /usr/lib 2>/dev/null` \ |
288 | 287 | `ls -d /usr/lib64 2>/dev/null` \ |
289 | `ls -d /usr/lib/tk8.6 2>/dev/null` \ | |
290 | `ls -d /usr/lib/tk8.5 2>/dev/null` \ | |
291 | 288 | `ls -d /usr/local/lib/tk8.6 2>/dev/null` \ |
292 | 289 | `ls -d /usr/local/lib/tk8.5 2>/dev/null` \ |
293 | 290 | `ls -d /usr/local/lib/tcl/tk8.6 2>/dev/null` \ |
373 | 370 | else |
374 | 371 | AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) |
375 | 372 | fi |
376 | ||
377 | # eval is required to do the TCL_DBGX substitution | |
378 | eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" | |
379 | eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" | |
380 | 373 | |
381 | 374 | # If the TCL_BIN_DIR is the build directory (not the install directory), |
382 | 375 | # then set the common variable name to the value of the build variables. |
411 | 404 | esac |
412 | 405 | fi |
413 | 406 | |
414 | # eval is required to do the TCL_DBGX substitution | |
415 | eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" | |
416 | eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" | |
417 | eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" | |
418 | eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" | |
419 | ||
420 | 407 | AC_SUBST(TCL_VERSION) |
421 | 408 | AC_SUBST(TCL_PATCH_LEVEL) |
422 | 409 | AC_SUBST(TCL_BIN_DIR) |
491 | 478 | else |
492 | 479 | AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) |
493 | 480 | fi |
494 | ||
495 | # eval is required to do the TK_DBGX substitution | |
496 | eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" | |
497 | eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" | |
498 | 481 | |
499 | 482 | # If the TK_BIN_DIR is the build directory (not the install directory), |
500 | 483 | # then set the common variable name to the value of the build variables. |
529 | 512 | esac |
530 | 513 | fi |
531 | 514 | |
532 | # eval is required to do the TK_DBGX substitution | |
533 | eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" | |
534 | eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" | |
535 | eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" | |
536 | eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" | |
537 | ||
538 | 515 | # TEA specific: Ensure windowingsystem is defined |
539 | 516 | if test "${TEA_PLATFORM}" = "unix" ; then |
540 | 517 | case ${TK_DEFS} in |
591 | 568 | if test -f "${TCL_BIN_DIR}/Makefile" ; then |
592 | 569 | # tclConfig.sh is in Tcl build directory |
593 | 570 | if test "${TEA_PLATFORM}" = "windows"; then |
594 | if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" ; then | |
595 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" | |
596 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" ; then | |
597 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}s${EXEEXT}" | |
598 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" ; then | |
599 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}t${EXEEXT}" | |
600 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" ; then | |
601 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}st${EXEEXT}" | |
571 | if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then | |
572 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" | |
573 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then | |
574 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" | |
575 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then | |
576 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" | |
577 | elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then | |
578 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" | |
602 | 579 | fi |
603 | 580 | else |
604 | 581 | TCLSH_PROG="${TCL_BIN_DIR}/tclsh" |
606 | 583 | else |
607 | 584 | # tclConfig.sh is in install location |
608 | 585 | if test "${TEA_PLATFORM}" = "windows"; then |
609 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" | |
586 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" | |
610 | 587 | else |
611 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" | |
588 | TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" | |
612 | 589 | fi |
613 | 590 | list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ |
614 | 591 | `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ |
649 | 626 | if test -f "${TK_BIN_DIR}/Makefile" ; then |
650 | 627 | # tkConfig.sh is in Tk build directory |
651 | 628 | if test "${TEA_PLATFORM}" = "windows"; then |
652 | if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" ; then | |
653 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" | |
654 | elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}s${EXEEXT}" ; then | |
655 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}$s{EXEEXT}" | |
656 | elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}t${EXEEXT}" ; then | |
657 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}t${EXEEXT}" | |
658 | elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}st${EXEEXT}" ; then | |
659 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}st${EXEEXT}" | |
629 | if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" ; then | |
630 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" | |
631 | elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}s${EXEEXT}" ; then | |
632 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}$s{EXEEXT}" | |
633 | elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" ; then | |
634 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" | |
635 | elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" ; then | |
636 | WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" | |
660 | 637 | fi |
661 | 638 | else |
662 | 639 | WISH_PROG="${TK_BIN_DIR}/wish" |
664 | 641 | else |
665 | 642 | # tkConfig.sh is in install location |
666 | 643 | if test "${TEA_PLATFORM}" = "windows"; then |
667 | WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" | |
644 | WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" | |
668 | 645 | else |
669 | WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" | |
646 | WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" | |
670 | 647 | fi |
671 | 648 | list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ |
672 | 649 | `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ |
712 | 689 | AC_DEFUN([TEA_ENABLE_SHARED], [ |
713 | 690 | AC_MSG_CHECKING([how to build libraries]) |
714 | 691 | AC_ARG_ENABLE(shared, |
715 | AC_HELP_STRING([--enable-shared], | |
692 | AS_HELP_STRING([--enable-shared], | |
716 | 693 | [build and link with shared libraries (default: on)]), |
717 | 694 | [shared_ok=$enableval], [shared_ok=yes]) |
718 | 695 | |
724 | 701 | fi |
725 | 702 | |
726 | 703 | AC_ARG_ENABLE(stubs, |
727 | AC_HELP_STRING([--enable-stubs], | |
704 | AS_HELP_STRING([--enable-stubs], | |
728 | 705 | [build and link with stub libraries. Always true for shared builds (default: on)]), |
729 | 706 | [stubs_ok=$enableval], [stubs_ok=yes]) |
730 | 707 | |
796 | 773 | |
797 | 774 | AC_DEFUN([TEA_ENABLE_THREADS], [ |
798 | 775 | AC_ARG_ENABLE(threads, |
799 | AC_HELP_STRING([--enable-threads], | |
776 | AS_HELP_STRING([--enable-threads], | |
800 | 777 | [build with threads (default: on)]), |
801 | 778 | [tcl_ok=$enableval], [tcl_ok=yes]) |
802 | 779 | |
910 | 887 | # Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false |
911 | 888 | # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true |
912 | 889 | # Sets to $(LDFLAGS_OPTIMIZE) if false |
913 | # DBGX Formerly used as debug library extension; | |
914 | # always blank now. | |
915 | 890 | #------------------------------------------------------------------------ |
916 | 891 | |
917 | 892 | AC_DEFUN([TEA_ENABLE_SYMBOLS], [ |
919 | 894 | AC_REQUIRE([TEA_CONFIG_CFLAGS]) |
920 | 895 | AC_MSG_CHECKING([for build with symbols]) |
921 | 896 | AC_ARG_ENABLE(symbols, |
922 | AC_HELP_STRING([--enable-symbols], | |
897 | AS_HELP_STRING([--enable-symbols], | |
923 | 898 | [build with debugging symbols (default: off)]), |
924 | 899 | [tcl_ok=$enableval], [tcl_ok=no]) |
925 | DBGX="" | |
926 | 900 | if test "$tcl_ok" = "no"; then |
927 | 901 | CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG" |
928 | 902 | LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" |
934 | 908 | AC_MSG_RESULT([yes (standard debugging)]) |
935 | 909 | fi |
936 | 910 | fi |
937 | # TEA specific: | |
938 | if test "${TEA_PLATFORM}" != "windows" ; then | |
939 | LDFLAGS_DEFAULT="${LDFLAGS}" | |
940 | fi | |
941 | 911 | AC_SUBST(CFLAGS_DEFAULT) |
942 | 912 | AC_SUBST(LDFLAGS_DEFAULT) |
943 | AC_SUBST(TCL_DBGX) | |
944 | 913 | |
945 | 914 | if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then |
946 | 915 | AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) |
975 | 944 | |
976 | 945 | AC_DEFUN([TEA_ENABLE_LANGINFO], [ |
977 | 946 | AC_ARG_ENABLE(langinfo, |
978 | AC_HELP_STRING([--enable-langinfo], | |
947 | AS_HELP_STRING([--enable-langinfo], | |
979 | 948 | [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), |
980 | 949 | [langinfo_ok=$enableval], [langinfo_ok=yes]) |
981 | 950 | |
1107 | 1076 | |
1108 | 1077 | AC_MSG_CHECKING([if 64bit support is requested]) |
1109 | 1078 | AC_ARG_ENABLE(64bit, |
1110 | AC_HELP_STRING([--enable-64bit], | |
1079 | AS_HELP_STRING([--enable-64bit], | |
1111 | 1080 | [enable 64bit support (default: off)]), |
1112 | 1081 | [do64bit=$enableval], [do64bit=no]) |
1113 | 1082 | AC_MSG_RESULT([$do64bit]) |
1116 | 1085 | |
1117 | 1086 | AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) |
1118 | 1087 | AC_ARG_ENABLE(64bit-vis, |
1119 | AC_HELP_STRING([--enable-64bit-vis], | |
1088 | AS_HELP_STRING([--enable-64bit-vis], | |
1120 | 1089 | [enable 64bit Sparc VIS support (default: off)]), |
1121 | 1090 | [do64bitVIS=$enableval], [do64bitVIS=no]) |
1122 | 1091 | AC_MSG_RESULT([$do64bitVIS]) |
1145 | 1114 | |
1146 | 1115 | AC_MSG_CHECKING([if rpath support is requested]) |
1147 | 1116 | AC_ARG_ENABLE(rpath, |
1148 | AC_HELP_STRING([--disable-rpath], | |
1117 | AS_HELP_STRING([--disable-rpath], | |
1149 | 1118 | [disable rpath support (default: on)]), |
1150 | 1119 | [doRpath=$enableval], [doRpath=yes]) |
1151 | 1120 | AC_MSG_RESULT([$doRpath]) |
1190 | 1159 | case $system in |
1191 | 1160 | # TEA specific: |
1192 | 1161 | windows) |
1193 | # This is a 2-stage check to make sure we have the 64-bit SDK | |
1194 | # We have to know where the SDK is installed. | |
1195 | # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs | |
1196 | # MACHINE is IX86 for LINK, but this is used by the manifest, | |
1197 | # which requires x86|amd64|ia64. | |
1198 | 1162 | MACHINE="X86" |
1199 | 1163 | if test "$do64bit" != "no" ; then |
1200 | if test "x${MSSDK}x" = "xx" ; then | |
1201 | MSSDK="C:/Progra~1/Microsoft Platform SDK" | |
1202 | fi | |
1203 | MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` | |
1204 | PATH64="" | |
1205 | 1164 | case "$do64bit" in |
1206 | 1165 | amd64|x64|yes) |
1207 | 1166 | MACHINE="AMD64" ; # default to AMD64 64-bit build |
1208 | PATH64="${MSSDK}/Bin/Win64/x86/AMD64" | |
1209 | 1167 | ;; |
1210 | 1168 | ia64) |
1211 | 1169 | MACHINE="IA64" |
1212 | PATH64="${MSSDK}/Bin/Win64" | |
1213 | 1170 | ;; |
1214 | 1171 | esac |
1215 | if test "$GCC" != "yes" -a ! -d "${PATH64}" ; then | |
1216 | AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) | |
1217 | AC_MSG_WARN([Ensure latest Platform SDK is installed]) | |
1218 | do64bit="no" | |
1219 | else | |
1220 | AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) | |
1221 | do64bit_ok="yes" | |
1222 | fi | |
1223 | 1172 | fi |
1224 | 1173 | |
1225 | 1174 | if test "$GCC" != "yes" ; then |
1238 | 1187 | esac |
1239 | 1188 | |
1240 | 1189 | if test "$do64bit" != "no" ; then |
1241 | # All this magic is necessary for the Win64 SDK RC1 - hobbs | |
1242 | CC="\"${PATH64}/cl.exe\"" | |
1243 | CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" | |
1244 | RC="\"${MSSDK}/bin/rc.exe\"" | |
1245 | lflags="${lflags} -nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" | |
1246 | LINKBIN="\"${PATH64}/link.exe\"" | |
1190 | CC="cl.exe" | |
1191 | RC="rc.exe" | |
1192 | lflags="${lflags} -nologo -MACHINE:${MACHINE} " | |
1193 | LINKBIN="link.exe" | |
1247 | 1194 | CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" |
1248 | 1195 | CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" |
1249 | 1196 | # Avoid 'unresolved external symbol __security_cookie' |
1281 | 1228 | if test "$ac_cv_cross" = "yes"; then |
1282 | 1229 | case "$do64bit" in |
1283 | 1230 | amd64|x64|yes) |
1284 | CC="x86_64-w64-mingw32-gcc" | |
1231 | CC="x86_64-w64-mingw32-${CC}" | |
1285 | 1232 | LD="x86_64-w64-mingw32-ld" |
1286 | 1233 | AR="x86_64-w64-mingw32-ar" |
1287 | 1234 | RANLIB="x86_64-w64-mingw32-ranlib" |
1288 | 1235 | RC="x86_64-w64-mingw32-windres" |
1289 | 1236 | ;; |
1290 | 1237 | *) |
1291 | CC="i686-w64-mingw32-gcc" | |
1238 | CC="i686-w64-mingw32-${CC}" | |
1292 | 1239 | LD="i686-w64-mingw32-ld" |
1293 | 1240 | AR="i686-w64-mingw32-ar" |
1294 | 1241 | RANLIB="i686-w64-mingw32-ranlib" |
1357 | 1304 | # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC |
1358 | 1305 | SHLIB_LD="/usr/ccs/bin/ld -G -z text" |
1359 | 1306 | AS_IF([test "$GCC" = yes], [ |
1360 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
1307 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
1361 | 1308 | ], [ |
1362 | CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' | |
1309 | CC_SEARCH_FLAGS='"-R${LIB_RUNTIME_DIR}"' | |
1363 | 1310 | ]) |
1364 | LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' | |
1311 | LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' | |
1365 | 1312 | ], [ |
1366 | 1313 | AS_IF([test "$GCC" = yes], [ |
1367 | 1314 | SHLIB_LD='${CC} -shared -Wl,-bexpall' |
1370 | 1317 | LDFLAGS="$LDFLAGS -brtl" |
1371 | 1318 | ]) |
1372 | 1319 | SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" |
1373 | CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' | |
1320 | CC_SEARCH_FLAGS='"-L${LIB_RUNTIME_DIR}"' | |
1374 | 1321 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1375 | 1322 | ]) |
1376 | 1323 | ;; |
1406 | 1353 | SHLIB_LD='${CC} -shared' |
1407 | 1354 | SHLIB_SUFFIX=".dll" |
1408 | 1355 | SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a" |
1409 | AC_CACHE_CHECK(for Cygwin version of gcc, | |
1410 | ac_cv_cygwin, | |
1411 | AC_TRY_COMPILE([ | |
1412 | #ifdef __CYGWIN__ | |
1413 | #error cygwin | |
1414 | #endif | |
1415 | ], [], | |
1416 | ac_cv_cygwin=no, | |
1417 | ac_cv_cygwin=yes) | |
1418 | ) | |
1419 | if test "$ac_cv_cygwin" = "no"; then | |
1420 | AC_MSG_ERROR([${CC} is not a cygwin compiler.]) | |
1421 | fi | |
1422 | 1356 | EXEEXT=".exe" |
1423 | 1357 | do64bit_ok=yes |
1424 | 1358 | CC_SEARCH_FLAGS="" |
1456 | 1390 | SHLIB_CFLAGS="+z" |
1457 | 1391 | SHLIB_LD="ld -b" |
1458 | 1392 | LDFLAGS="$LDFLAGS -Wl,-E" |
1459 | CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' | |
1460 | LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' | |
1393 | CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' | |
1394 | LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' | |
1461 | 1395 | LD_LIBRARY_PATH_VAR="SHLIB_PATH" |
1462 | 1396 | ]) |
1463 | 1397 | AS_IF([test "$GCC" = yes], [ |
1476 | 1410 | do64bit_ok=yes |
1477 | 1411 | SHLIB_LD='${CC} -shared' |
1478 | 1412 | AS_IF([test $doRpath = yes], [ |
1479 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) | |
1413 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) | |
1480 | 1414 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1481 | 1415 | ;; |
1482 | 1416 | *) |
1497 | 1431 | SHLIB_LD="ld -b" |
1498 | 1432 | SHLIB_LD_LIBS="" |
1499 | 1433 | LDFLAGS="$LDFLAGS -Wl,-E" |
1500 | CC_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' | |
1501 | LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' | |
1434 | CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' | |
1435 | LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' | |
1502 | 1436 | LD_LIBRARY_PATH_VAR="SHLIB_PATH" |
1503 | 1437 | ]) ;; |
1504 | 1438 | IRIX-5.*) |
1507 | 1441 | SHLIB_SUFFIX=".so" |
1508 | 1442 | AC_LIBOBJ(mkstemp) |
1509 | 1443 | AS_IF([test $doRpath = yes], [ |
1510 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
1511 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) | |
1444 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
1445 | LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) | |
1512 | 1446 | ;; |
1513 | 1447 | IRIX-6.*) |
1514 | 1448 | SHLIB_CFLAGS="" |
1515 | 1449 | SHLIB_LD="ld -n32 -shared -rdata_shared" |
1516 | 1450 | SHLIB_SUFFIX=".so" |
1517 | 1451 | AS_IF([test $doRpath = yes], [ |
1518 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
1519 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) | |
1452 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
1453 | LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) | |
1520 | 1454 | AS_IF([test "$GCC" = yes], [ |
1521 | 1455 | CFLAGS="$CFLAGS -mabi=n32" |
1522 | 1456 | LDFLAGS="$LDFLAGS -mabi=n32" |
1538 | 1472 | SHLIB_LD="ld -n32 -shared -rdata_shared" |
1539 | 1473 | SHLIB_SUFFIX=".so" |
1540 | 1474 | AS_IF([test $doRpath = yes], [ |
1541 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
1542 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) | |
1475 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
1476 | LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) | |
1543 | 1477 | |
1544 | 1478 | # Check to enable 64-bit flags for compiler/linker |
1545 | 1479 | |
1554 | 1488 | ]) |
1555 | 1489 | ]) |
1556 | 1490 | ;; |
1557 | Linux*|GNU*|NetBSD-Debian) | |
1491 | Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) | |
1558 | 1492 | SHLIB_CFLAGS="-fPIC" |
1559 | 1493 | SHLIB_SUFFIX=".so" |
1560 | 1494 | |
1564 | 1498 | # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS |
1565 | 1499 | SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS_DEFAULT} -shared' |
1566 | 1500 | LDFLAGS="$LDFLAGS -Wl,--export-dynamic" |
1501 | ||
1502 | case $system in | |
1503 | DragonFly-*|FreeBSD-*) | |
1504 | AS_IF([test "${TCL_THREADS}" = "1"], [ | |
1505 | # The -pthread needs to go in the LDFLAGS, not LIBS | |
1506 | LIBS=`echo $LIBS | sed s/-pthread//` | |
1507 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
1508 | LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) | |
1509 | ;; | |
1510 | esac | |
1511 | ||
1567 | 1512 | AS_IF([test $doRpath = yes], [ |
1568 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) | |
1513 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) | |
1569 | 1514 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1570 | 1515 | AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) |
1571 | 1516 | AS_IF([test $do64bit = yes], [ |
1595 | 1540 | SHLIB_LD='${CC} -shared' |
1596 | 1541 | LD_FLAGS="-Wl,--export-dynamic" |
1597 | 1542 | AS_IF([test $doRpath = yes], [ |
1598 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
1599 | LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) | |
1543 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
1544 | LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) | |
1600 | 1545 | ;; |
1601 | 1546 | OpenBSD-*) |
1602 | 1547 | arch=`arch -s` |
1611 | 1556 | SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' |
1612 | 1557 | SHLIB_SUFFIX=".so" |
1613 | 1558 | AS_IF([test $doRpath = yes], [ |
1614 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) | |
1559 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) | |
1615 | 1560 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1616 | 1561 | SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' |
1617 | LDFLAGS="-Wl,-export-dynamic" | |
1562 | LDFLAGS="$LDFLAGS -Wl,-export-dynamic" | |
1618 | 1563 | CFLAGS_OPTIMIZE="-O2" |
1619 | 1564 | # On OpenBSD: Compile with -pthread |
1620 | 1565 | # Don't link with -lpthread |
1631 | 1576 | SHLIB_SUFFIX=".so" |
1632 | 1577 | LDFLAGS="$LDFLAGS -export-dynamic" |
1633 | 1578 | AS_IF([test $doRpath = yes], [ |
1634 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) | |
1579 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) | |
1635 | 1580 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1636 | 1581 | # The -pthread needs to go in the CFLAGS, not LIBS |
1637 | 1582 | LIBS=`echo $LIBS | sed s/-pthread//` |
1638 | 1583 | CFLAGS="$CFLAGS -pthread" |
1639 | 1584 | LDFLAGS="$LDFLAGS -pthread" |
1640 | ;; | |
1641 | DragonFly-*|FreeBSD-*) | |
1642 | # This configuration from FreeBSD Ports. | |
1643 | SHLIB_CFLAGS="-fPIC" | |
1644 | SHLIB_LD="${CC} -shared" | |
1645 | SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,-soname,\$[@]" | |
1646 | SHLIB_SUFFIX=".so" | |
1647 | LDFLAGS="" | |
1648 | AS_IF([test $doRpath = yes], [ | |
1649 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
1650 | LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}']) | |
1651 | # The -pthread needs to go in the LDFLAGS, not LIBS | |
1652 | LIBS=`echo $LIBS | sed s/-pthread//` | |
1653 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | |
1654 | LDFLAGS="$LDFLAGS $PTHREAD_LIBS" | |
1655 | case $system in | |
1656 | FreeBSD-3.*) | |
1657 | # Version numbers are dot-stripped by system policy. | |
1658 | TCL_TRIM_DOTS=`echo ${PACKAGE_VERSION} | tr -d .` | |
1659 | UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' | |
1660 | SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1' | |
1661 | TCL_LIB_VERSIONS_OK=nodots | |
1662 | ;; | |
1663 | esac | |
1664 | 1585 | ;; |
1665 | 1586 | Darwin-*) |
1666 | 1587 | CFLAGS_OPTIMIZE="-Os" |
1795 | 1716 | ]) |
1796 | 1717 | SHLIB_SUFFIX=".so" |
1797 | 1718 | AS_IF([test $doRpath = yes], [ |
1798 | CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' | |
1719 | CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' | |
1799 | 1720 | LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) |
1800 | 1721 | AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [ |
1801 | 1722 | CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"]) |
1848 | 1769 | SHLIB_SUFFIX=".so" |
1849 | 1770 | AS_IF([test "$GCC" = yes], [ |
1850 | 1771 | SHLIB_LD='${CC} -shared' |
1851 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
1772 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
1852 | 1773 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1853 | 1774 | ], [ |
1854 | 1775 | SHLIB_LD="/usr/ccs/bin/ld -G -z text" |
1855 | CC_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' | |
1776 | CC_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' | |
1856 | 1777 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1857 | 1778 | ]) |
1858 | 1779 | ;; |
1918 | 1839 | SHLIB_SUFFIX=".so" |
1919 | 1840 | AS_IF([test "$GCC" = yes], [ |
1920 | 1841 | SHLIB_LD='${CC} -shared' |
1921 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
1842 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
1922 | 1843 | LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} |
1923 | 1844 | AS_IF([test "$do64bit_ok" = yes], [ |
1924 | 1845 | AS_IF([test "$arch" = "sparcv9 sparc"], [ |
1945 | 1866 | *) |
1946 | 1867 | SHLIB_LD='/usr/ccs/bin/ld -G -z text';; |
1947 | 1868 | esac |
1948 | CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' | |
1949 | LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' | |
1869 | CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' | |
1870 | LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' | |
1950 | 1871 | ]) |
1951 | 1872 | ;; |
1952 | 1873 | UNIX_SV* | UnixWare-5*) |
2112 | 2033 | AC_SUBST(CFLAGS_DEBUG) |
2113 | 2034 | AC_SUBST(CFLAGS_OPTIMIZE) |
2114 | 2035 | AC_SUBST(CFLAGS_WARNING) |
2036 | AC_SUBST(LDFLAGS_DEBUG) | |
2037 | AC_SUBST(LDFLAGS_OPTIMIZE) | |
2115 | 2038 | |
2116 | 2039 | AC_SUBST(STLIB_LD) |
2117 | 2040 | AC_SUBST(SHLIB_LD) |
2395 | 2318 | # HAVE_TM_GMTOFF |
2396 | 2319 | # HAVE_TM_TZADJ |
2397 | 2320 | # HAVE_TIMEZONE_VAR |
2321 | # | |
2398 | 2322 | #-------------------------------------------------------------------- |
2399 | 2323 | |
2400 | 2324 | AC_DEFUN([TEA_TIME_HANDLER], [ |
2402 | 2326 | AC_HEADER_TIME |
2403 | 2327 | AC_STRUCT_TIMEZONE |
2404 | 2328 | |
2405 | AC_CHECK_FUNCS(gmtime_r localtime_r) | |
2329 | AC_CHECK_FUNCS(gmtime_r localtime_r mktime) | |
2406 | 2330 | |
2407 | 2331 | AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ |
2408 | 2332 | AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_tzadj;], |
2470 | 2394 | if test "$tcl_strtod" = 1; then |
2471 | 2395 | AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ |
2472 | 2396 | AC_TRY_RUN([ |
2397 | #include <stdlib.h> | |
2473 | 2398 | extern double strtod(); |
2474 | 2399 | int main() { |
2475 | 2400 | char *infString="Inf", *nanString="NaN", *spaceString=" "; |
2499 | 2424 | ]) |
2500 | 2425 | |
2501 | 2426 | #-------------------------------------------------------------------- |
2427 | # TEA_TCL_LINK_LIBS | |
2428 | # | |
2429 | # Search for the libraries needed to link the Tcl shell. | |
2430 | # Things like the math library (-lm), socket stuff (-lsocket vs. | |
2431 | # -lnsl), zlib (-lz) and libtommath (-ltommath) are dealt with here. | |
2432 | # | |
2433 | # Arguments: | |
2434 | # None. | |
2435 | # | |
2436 | # Results: | |
2437 | # | |
2438 | # Might append to the following vars: | |
2439 | # LIBS | |
2440 | # MATH_LIBS | |
2441 | # | |
2442 | # Might define the following vars: | |
2443 | # HAVE_NET_ERRNO_H | |
2444 | # | |
2445 | #-------------------------------------------------------------------- | |
2446 | ||
2447 | AC_DEFUN([TEA_TCL_LINK_LIBS], [ | |
2448 | #-------------------------------------------------------------------- | |
2449 | # On a few very rare systems, all of the libm.a stuff is | |
2450 | # already in libc.a. Set compiler flags accordingly. | |
2451 | #-------------------------------------------------------------------- | |
2452 | ||
2453 | AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") | |
2454 | ||
2455 | #-------------------------------------------------------------------- | |
2456 | # Interactive UNIX requires -linet instead of -lsocket, plus it | |
2457 | # needs net/errno.h to define the socket-related error codes. | |
2458 | #-------------------------------------------------------------------- | |
2459 | ||
2460 | AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) | |
2461 | AC_CHECK_HEADER(net/errno.h, [ | |
2462 | AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have <net/errno.h>?])]) | |
2463 | ||
2464 | #-------------------------------------------------------------------- | |
2465 | # Check for the existence of the -lsocket and -lnsl libraries. | |
2466 | # The order here is important, so that they end up in the right | |
2467 | # order in the command line generated by make. Here are some | |
2468 | # special considerations: | |
2469 | # 1. Use "connect" and "accept" to check for -lsocket, and | |
2470 | # "gethostbyname" to check for -lnsl. | |
2471 | # 2. Use each function name only once: can't redo a check because | |
2472 | # autoconf caches the results of the last check and won't redo it. | |
2473 | # 3. Use -lnsl and -lsocket only if they supply procedures that | |
2474 | # aren't already present in the normal libraries. This is because | |
2475 | # IRIX 5.2 has libraries, but they aren't needed and they're | |
2476 | # bogus: they goof up name resolution if used. | |
2477 | # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. | |
2478 | # To get around this problem, check for both libraries together | |
2479 | # if -lsocket doesn't work by itself. | |
2480 | #-------------------------------------------------------------------- | |
2481 | ||
2482 | tcl_checkBoth=0 | |
2483 | AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) | |
2484 | if test "$tcl_checkSocket" = 1; then | |
2485 | AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, | |
2486 | LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) | |
2487 | fi | |
2488 | if test "$tcl_checkBoth" = 1; then | |
2489 | tk_oldLibs=$LIBS | |
2490 | LIBS="$LIBS -lsocket -lnsl" | |
2491 | AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) | |
2492 | fi | |
2493 | AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, | |
2494 | [LIBS="$LIBS -lnsl"])]) | |
2495 | AC_CHECK_FUNC(mp_log_u32, , [AC_CHECK_LIB(tommath, mp_log_u32, | |
2496 | [LIBS="$LIBS -ltommath"])]) | |
2497 | AC_CHECK_FUNC(deflateSetHeader, , [AC_CHECK_LIB(z, deflateSetHeader, | |
2498 | [LIBS="$LIBS -lz"])]) | |
2499 | ]) | |
2500 | ||
2501 | #-------------------------------------------------------------------- | |
2502 | 2502 | # TEA_TCL_EARLY_FLAGS |
2503 | 2503 | # |
2504 | 2504 | # Check for what flags are needed to be passed so the correct OS |
2513 | 2513 | # _ISOC99_SOURCE |
2514 | 2514 | # _LARGEFILE64_SOURCE |
2515 | 2515 | # _LARGEFILE_SOURCE64 |
2516 | # | |
2516 | 2517 | #-------------------------------------------------------------------- |
2517 | 2518 | |
2518 | 2519 | AC_DEFUN([TEA_TCL_EARLY_FLAG],[ |
2933 | 2934 | for i in $vars; do |
2934 | 2935 | if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then |
2935 | 2936 | # Convert foo.lib to -lfoo for GCC. No-op if not *.lib |
2936 | i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` | |
2937 | i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.[[lL]][[iI]][[bB]][$]/-l\1/'` | |
2937 | 2938 | fi |
2938 | 2939 | PKG_LIBS="$PKG_LIBS $i" |
2939 | 2940 | done |
3120 | 3121 | AC_DEFUN([TEA_MAKE_LIB], [ |
3121 | 3122 | if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then |
3122 | 3123 | MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" |
3123 | MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" | |
3124 | MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" | |
3124 | 3125 | AC_EGREP_CPP([manifest needed], [ |
3125 | 3126 | #if defined(_MSC_VER) && _MSC_VER >= 1400 |
3126 | 3127 | print("manifest needed") |
3135 | 3136 | MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\[$]@ \$(PKG_STUB_OBJECTS)" |
3136 | 3137 | else |
3137 | 3138 | MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" |
3138 | MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" | |
3139 | MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" | |
3139 | 3140 | MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" |
3140 | 3141 | fi |
3141 | 3142 | |
3877 | 3878 | # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) |
3878 | 3879 | eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}" |
3879 | 3880 | if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then |
3880 | eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}${DBGX}" | |
3881 | eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}${DBGX}" | |
3881 | eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}" | |
3882 | eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}" | |
3882 | 3883 | else |
3883 | eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" | |
3884 | eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`${DBGX}" | |
3884 | eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`" | |
3885 | eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`" | |
3885 | 3886 | fi |
3886 | 3887 | $1_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${$1_LIB_FLAG}" |
3887 | 3888 | $1_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` ${$1_LIB_FLAG}" |
113 | 113 | namespace which -command x |
114 | 114 | } -cleanup $cleanup2 -result ::x |
115 | 115 | |
116 | test basic-1.7a {objects are added to the master list | |
116 | test basic-1.7a {objects are added to the global list | |
117 | 117 | } -setup $setup2 -body { |
118 | 118 | itcl::find objects x |
119 | 119 | } -cleanup $cleanup2 -result x |
120 | 120 | |
121 | test basic-1.7b {objects are added to the master list | |
121 | test basic-1.7b {objects are added to the global list | |
122 | 122 | } -setup $setup2 -body { |
123 | 123 | itcl::find objects -class Counter x |
124 | 124 | } -cleanup $cleanup2 -result x |
13 | 13 | package require tcltest 2.2 |
14 | 14 | namespace import ::tcltest::test |
15 | 15 | ::tcltest::loadTestedCommands |
16 | set ::itcllib [lindex [package ifneeded itcl [package require itcl]] 1] | |
16 | package require itcl | |
17 | set ::itcllib [lindex [lsearch -exact -index 1 -inline [info loaded] Itcl] 0] | |
17 | 18 | |
18 | 19 | # ---------------------------------------------------------------------- |
19 | 20 | # Test "itcl::import::stub" command |
44 | 45 | set interp [interp create] |
45 | 46 | $interp eval {set ::tcl::inl_mem_test 0} |
46 | 47 | $interp eval " |
47 | [list ::load $::itcllib itcl] | |
48 | [list ::load $::itcllib Itcl] | |
48 | 49 | [::tcltest::configure -load] |
49 | 50 | proc auto_load {cmd {namespace {}}} { |
50 | 51 | global debug |
94 | 95 | set interp [interp create] |
95 | 96 | $interp eval {set ::tcl::inl_mem_test 0} |
96 | 97 | $interp eval " |
97 | [list ::load $::itcllib itcl] | |
98 | [list ::load $::itcllib Itcl] | |
98 | 99 | [::tcltest::configure -load] |
99 | 100 | proc auto_load {cmd {namespace {}}} { |
100 | 101 | proc \$cmd {args} \[format {return \"%s: \$args\"} \$cmd\] |
0 | 0 | # |
1 | # Tests for using [incr Tcl] in slave interpreters | |
1 | # Tests for using [incr Tcl] in child interpreters | |
2 | 2 | # ---------------------------------------------------------------------- |
3 | 3 | # AUTHOR: Michael J. McLennan |
4 | 4 | # Bell Labs Innovations for Lucent Technologies |
16 | 16 | package require itcl |
17 | 17 | |
18 | 18 | # ---------------------------------------------------------------------- |
19 | # Make sure that slave interpreters can be created and loaded | |
19 | # Make sure that child interpreters can be created and loaded | |
20 | 20 | # with [incr Tcl]... |
21 | 21 | # ---------------------------------------------------------------------- |
22 | test interp-1.1 {create a slave interp with [incr Tcl]} { | |
23 | interp create slave | |
24 | load "" Itcl slave | |
25 | list [slave eval "namespace children :: itcl"] [interp delete slave] | |
22 | test interp-1.1 {create a child interp with [incr Tcl]} { | |
23 | interp create child | |
24 | load "" Itcl child | |
25 | list [child eval "namespace children :: itcl"] [interp delete child] | |
26 | 26 | } {::itcl {}} |
27 | 27 | |
28 | test interp-1.2 {create a safe slave interp with [incr Tcl]} { | |
29 | interp create -safe slave | |
30 | load "" Itcl slave | |
31 | list [slave eval "namespace children :: itcl"] [interp delete slave] | |
28 | test interp-1.2 {create a safe child interp with [incr Tcl]} { | |
29 | interp create -safe child | |
30 | load "" Itcl child | |
31 | list [child eval "namespace children :: itcl"] [interp delete child] | |
32 | 32 | } {::itcl {}} |
33 | 33 | |
34 | test interp-1.3 {errors are okay when slave interp is deleted} { | |
35 | catch {interp delete slave} | |
36 | interp create slave | |
37 | load "" Itcl slave | |
38 | slave eval { | |
34 | test interp-1.3 {errors are okay when child interp is deleted} { | |
35 | catch {interp delete child} | |
36 | interp create child | |
37 | load "" Itcl child | |
38 | child eval { | |
39 | 39 | itcl::class Troublemaker { |
40 | 40 | destructor { error "cannot delete this object" } |
41 | 41 | } |
50 | 50 | } |
51 | 51 | Foo f |
52 | 52 | } |
53 | interp delete slave | |
53 | interp delete child | |
54 | 54 | } {} |
55 | 55 | |
56 | 56 | test interp-1.4 {one namespace can cause another to be destroyed} { |
57 | interp create slave | |
58 | load "" Itcl slave | |
59 | slave eval { | |
57 | interp create child | |
58 | load "" Itcl child | |
59 | child eval { | |
60 | 60 | namespace eval group { |
61 | 61 | itcl::class base1 {} |
62 | 62 | itcl::class base2 {} |
65 | 65 | inherit group::base1 group::base2 |
66 | 66 | } |
67 | 67 | } |
68 | interp delete slave | |
68 | interp delete child | |
69 | 69 | } {} |
70 | 70 | |
71 | 71 | test interp-1.5 {cleanup interp object list, this should not |
72 | 72 | include an object that deletes itself in ctor} { |
73 | interp create slave | |
74 | load "" Itcl slave | |
75 | slave eval { | |
73 | interp create child | |
74 | load "" Itcl child | |
75 | child eval { | |
76 | 76 | itcl::class DeleteSelf { |
77 | 77 | constructor {} { |
78 | 78 | itcl::delete object $this |
80 | 80 | } |
81 | 81 | DeleteSelf ds |
82 | 82 | } |
83 | interp delete slave | |
83 | interp delete child | |
84 | 84 | } {} |
85 | 85 | |
86 | 86 | ::tcltest::cleanupTests |
152 | 152 | } |
153 | 153 | list 0 |
154 | 154 | } 0 |
155 | test methods-2.2 {covers leak condition test for nested methods calls within eval, bug [8e632ce049]} -setup { | |
156 | itcl::class C1 { | |
157 | proc factory {} { | |
158 | set obj [C1 #auto] | |
159 | $obj myeval [list $obj read] | |
160 | itcl::delete object $obj | |
161 | } | |
162 | method myeval {script} { eval $script } | |
163 | method read {} { myeval {} } | |
164 | } | |
165 | } -body { | |
166 | time { C1::factory } 50 | |
167 | list 0 | |
168 | } -result 0 -cleanup { | |
169 | itcl::delete class C1 | |
170 | } | |
171 | test methods-2.3 {call of method after object is destroyed inside other methods, SF-bug [c1289b1c32]} -setup { | |
172 | proc c1test {} { | |
173 | return c1test | |
174 | } | |
175 | itcl::class C1 { | |
176 | public method m1 {} { | |
177 | itcl::delete object $this | |
178 | c1test | |
179 | } | |
180 | public method m2 {} { | |
181 | rename $this {} | |
182 | c1test | |
183 | } | |
184 | public method c1test {} { | |
185 | return C1::c1test | |
186 | } | |
187 | } | |
188 | } -body { | |
189 | set result {} | |
190 | set obj [C1 #auto] | |
191 | lappend result [catch {$obj m1} v] $v [namespace which -command $obj] | |
192 | set obj [C1 #auto] | |
193 | lappend result [catch {$obj m2} v] $v [namespace which -command $obj] | |
194 | } -match glob -result {1 * {} 1 * {}} -cleanup { | |
195 | itcl::delete class C1 | |
196 | rename c1test {} | |
197 | } | |
155 | 198 | |
156 | 199 | # ---------------------------------------------------------------------- |
157 | 200 | # Clean up |
456 | 456 | -cleanup {interp delete $interp} |
457 | 457 | |
458 | 458 | test sfbug-259 { SF bug #257 } -setup { |
459 | interp create slave | |
460 | load {} Itcl slave | |
461 | } -cleanup { | |
462 | interp delete slave | |
463 | } -body { | |
464 | slave eval { | |
459 | interp create child | |
460 | load {} Itcl child | |
461 | } -cleanup { | |
462 | interp delete child | |
463 | } -body { | |
464 | child eval { | |
465 | 465 | proc do_uplevel { body } { |
466 | 466 | uplevel 1 $body |
467 | 467 | } |
30 | 30 | # We extract version numbers using the nmakehlp program. For now use |
31 | 31 | # the local copy of nmakehlp. Once we locate Tcl, we will use that |
32 | 32 | # one if it is newer. |
33 | !if [$(CC) -nologo "nmakehlp.c" -link -subsystem:console > nul] | |
33 | !if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul] | |
34 | 34 | !endif |
35 | 35 | |
36 | 36 | # First locate the Tcl directory that we are working with. |
37 | !ifdef TCLDIR | |
37 | !if "$(TCLDIR)" != "" | |
38 | 38 | |
39 | 39 | _RULESDIR = $(TCLDIR:/=\) |
40 | 40 |
5 | 5 | # compiler switches, defining common targets and macros. The Tcl makefile |
6 | 6 | # directly includes this. Extensions include it via "rules-ext.vc". |
7 | 7 | # |
8 | # See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for | |
8 | # See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for | |
9 | 9 | # detailed documentation. |
10 | 10 | # |
11 | 11 | # See the file "license.terms" for information on usage and redistribution |
23 | 23 | # For modifications that are not backward-compatible, you *must* change |
24 | 24 | # the major version. |
25 | 25 | RULES_VERSION_MAJOR = 1 |
26 | RULES_VERSION_MINOR = 4 | |
26 | RULES_VERSION_MINOR = 8 | |
27 | 27 | |
28 | 28 | # The PROJECT macro must be defined by parent makefile. |
29 | 29 | !if "$(PROJECT)" == "" |
301 | 301 | _TCLDIR = $(_INSTALLDIR)\.. |
302 | 302 | _TCL_H = $(_TCLDIR)\include\tcl.h |
303 | 303 | |
304 | !else # exist(...) && ! $(NEED_TCL_SOURCE) | |
304 | !else # exist(...) && !$(NEED_TCL_SOURCE) | |
305 | 305 | |
306 | 306 | !if [echo _TCLDIR = \> nmakehlp.out] \ |
307 | 307 | || [nmakehlp -L generic\tcl.h >> nmakehlp.out] |
312 | 312 | TCLDIR = $(_TCLDIR) |
313 | 313 | _TCL_H = $(_TCLDIR)\generic\tcl.h |
314 | 314 | |
315 | !endif # exist(...) && ! $(NEED_TCL_SOURCE) | |
315 | !endif # exist(...) && !$(NEED_TCL_SOURCE) | |
316 | 316 | |
317 | 317 | !endif # TCLDIR |
318 | 318 | |
414 | 414 | # NATIVE_ARCH - set to IX86 or AMD64 for the host machine |
415 | 415 | # MACHINE - same as $(ARCH) - legacy |
416 | 416 | # _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed |
417 | # CFG_ENCODING - set to an character encoding. | |
418 | # TBD - this is passed to compiler as TCL_CFGVAL_ENCODING but can't | |
419 | # see where it is used | |
420 | 417 | |
421 | 418 | cc32 = $(CC) # built-in default. |
422 | 419 | link32 = link |
502 | 499 | _VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2 |
503 | 500 | !endif |
504 | 501 | |
505 | !ifndef CFG_ENCODING | |
506 | CFG_ENCODING = \"cp1252\" | |
507 | !endif | |
508 | ||
509 | 502 | ################################################################ |
510 | 503 | # 4. Build the nmakehlp program |
511 | 504 | # This is a helper app we need to overcome nmake's limiting |
513 | 506 | # information about supported compiler options etc. |
514 | 507 | # |
515 | 508 | # Tcl itself will always use the nmakehlp.c program which is |
516 | # in its own source. This is the "master" copy and kept updated. | |
509 | # in its own source. It will be kept updated there. | |
517 | 510 | # |
518 | 511 | # Extensions built against an installed Tcl will use the installed |
519 | 512 | # copy of Tcl's nmakehlp.c if there is one and their own version |
536 | 529 | !if exist("$(_TCLDIR)\lib\nmake\nmakehlp.c") |
537 | 530 | NMAKEHLPC = $(_TCLDIR)\lib\nmake\nmakehlp.c |
538 | 531 | !endif |
539 | !else # ! $(TCLINSTALL) | |
532 | !else # !$(TCLINSTALL) | |
540 | 533 | !if exist("$(_TCLDIR)\win\nmakehlp.c") |
541 | 534 | NMAKEHLPC = $(_TCLDIR)\win\nmakehlp.c |
542 | 535 | !endif |
658 | 651 | !endif |
659 | 652 | !endif |
660 | 653 | |
654 | ||
655 | ################################################################ | |
656 | # 6. Extract various version numbers from headers | |
657 | # For Tcl and Tk, version numbers are extracted from tcl.h and tk.h | |
658 | # respectively. For extensions, versions are extracted from the | |
659 | # configure.in or configure.ac from the TEA configuration if it | |
660 | # exists, and unset otherwise. | |
661 | # Sets the following macros: | |
662 | # TCL_MAJOR_VERSION | |
663 | # TCL_MINOR_VERSION | |
664 | # TCL_RELEASE_SERIAL | |
665 | # TCL_PATCH_LEVEL | |
666 | # TCL_PATCH_LETTER | |
667 | # TCL_VERSION | |
668 | # TK_MAJOR_VERSION | |
669 | # TK_MINOR_VERSION | |
670 | # TK_RELEASE_SERIAL | |
671 | # TK_PATCH_LEVEL | |
672 | # TK_PATCH_LETTER | |
673 | # TK_VERSION | |
674 | # DOTVERSION - set as (for example) 2.5 | |
675 | # VERSION - set as (for example 25) | |
676 | #-------------------------------------------------------------- | |
677 | ||
678 | !if [echo REM = This file is generated from rules.vc > versions.vc] | |
679 | !endif | |
680 | !if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ | |
681 | && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] | |
682 | !endif | |
683 | !if [echo TCL_MINOR_VERSION = \>> versions.vc] \ | |
684 | && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] | |
685 | !endif | |
686 | !if [echo TCL_RELEASE_SERIAL = \>> versions.vc] \ | |
687 | && [nmakehlp -V "$(_TCL_H)" TCL_RELEASE_SERIAL >> versions.vc] | |
688 | !endif | |
689 | !if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ | |
690 | && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] | |
691 | !endif | |
692 | ||
693 | !if defined(_TK_H) | |
694 | !if [echo TK_MAJOR_VERSION = \>> versions.vc] \ | |
695 | && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] | |
696 | !endif | |
697 | !if [echo TK_MINOR_VERSION = \>> versions.vc] \ | |
698 | && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] | |
699 | !endif | |
700 | !if [echo TK_RELEASE_SERIAL = \>> versions.vc] \ | |
701 | && [nmakehlp -V "$(_TK_H)" TK_RELEASE_SERIAL >> versions.vc] | |
702 | !endif | |
703 | !if [echo TK_PATCH_LEVEL = \>> versions.vc] \ | |
704 | && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] | |
705 | !endif | |
706 | !endif # _TK_H | |
707 | ||
708 | !include versions.vc | |
709 | ||
710 | TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) | |
711 | TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) | |
712 | !if [nmakehlp -f $(TCL_PATCH_LEVEL) "a"] | |
713 | TCL_PATCH_LETTER = a | |
714 | !elseif [nmakehlp -f $(TCL_PATCH_LEVEL) "b"] | |
715 | TCL_PATCH_LETTER = b | |
716 | !else | |
717 | TCL_PATCH_LETTER = . | |
718 | !endif | |
719 | ||
720 | !if defined(_TK_H) | |
721 | ||
722 | TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) | |
723 | TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) | |
724 | !if [nmakehlp -f $(TK_PATCH_LEVEL) "a"] | |
725 | TK_PATCH_LETTER = a | |
726 | !elseif [nmakehlp -f $(TK_PATCH_LEVEL) "b"] | |
727 | TK_PATCH_LETTER = b | |
728 | !else | |
729 | TK_PATCH_LETTER = . | |
730 | !endif | |
731 | ||
732 | !endif | |
733 | ||
734 | # Set DOTVERSION and VERSION | |
735 | !if $(DOING_TCL) | |
736 | ||
737 | DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) | |
738 | VERSION = $(TCL_VERSION) | |
739 | ||
740 | !elseif $(DOING_TK) | |
741 | ||
742 | DOTVERSION = $(TK_DOTVERSION) | |
743 | VERSION = $(TK_VERSION) | |
744 | ||
745 | !else # Doing a non-Tk extension | |
746 | ||
747 | # If parent makefile has not defined DOTVERSION, try to get it from TEA | |
748 | # first from a configure.in file, and then from configure.ac | |
749 | !ifndef DOTVERSION | |
750 | !if [echo DOTVERSION = \> versions.vc] \ | |
751 | || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc] | |
752 | !if [echo DOTVERSION = \> versions.vc] \ | |
753 | || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc] | |
754 | !error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc. | |
755 | !endif | |
756 | !endif | |
757 | !include versions.vc | |
758 | !endif # DOTVERSION | |
759 | VERSION = $(DOTVERSION:.=) | |
760 | ||
761 | !endif # $(DOING_TCL) ... etc. | |
762 | ||
763 | # Windows RC files have 3 version components. Ensure this irrespective | |
764 | # of how many components the package has specified. Basically, ensure | |
765 | # minimum 4 components by appending 4 0's and then pick out the first 4. | |
766 | # Also take care of the fact that DOTVERSION may have "a" or "b" instead | |
767 | # of "." separating the version components. | |
768 | DOTSEPARATED=$(DOTVERSION:a=.) | |
769 | DOTSEPARATED=$(DOTSEPARATED:b=.) | |
770 | !if [echo RCCOMMAVERSION = \> versions.vc] \ | |
771 | || [for /f "tokens=1,2,3,4,5* delims=." %a in ("$(DOTSEPARATED).0.0.0.0") do echo %a,%b,%c,%d >> versions.vc] | |
772 | !error *** Could not generate RCCOMMAVERSION *** | |
773 | !endif | |
774 | !include versions.vc | |
775 | ||
661 | 776 | ######################################################################## |
662 | # 6. Parse the OPTS macro to work out the requested build configuration. | |
777 | # 7. Parse the OPTS macro to work out the requested build configuration. | |
663 | 778 | # Based on this, we will construct the actual switches to be passed to the |
664 | 779 | # compiler and linker using the macros defined in the previous section. |
665 | 780 | # The following macros are defined by this section based on OPTS |
673 | 788 | # MSVCRT - 1 -> link to dynamic C runtime even when building static Tcl build |
674 | 789 | # 0 -> link to static C runtime for static Tcl build. |
675 | 790 | # Does not impact shared Tcl builds (STATIC_BUILD == 0) |
791 | # Default: 1 for Tcl 8.7 and up, 0 otherwise. | |
676 | 792 | # TCL_USE_STATIC_PACKAGES - 1 -> statically link the registry and dde extensions |
677 | # in the Tcl shell. 0 -> keep them as shared libraries | |
678 | # Does not impact shared Tcl builds. | |
793 | # in the Tcl and Wish shell. 0 -> keep them as shared libraries. Does | |
794 | # not impact shared Tcl builds. Implied by STATIC_BUILD since Tcl 8.7. | |
679 | 795 | # USE_THREAD_ALLOC - 1 -> Use a shared global free pool for allocation. |
680 | 796 | # 0 -> Use the non-thread allocator. |
681 | 797 | # UNCHECKED - 1 -> when doing a debug build with symbols, use the release |
684 | 800 | # CONFIG_CHECK - 1 -> check current build configuration against Tcl |
685 | 801 | # configuration (ignored for Tcl itself) |
686 | 802 | # _USE_64BIT_TIME_T - forces a build using 64-bit time_t for 32-bit build |
687 | # (CRT library should support this) | |
803 | # (CRT library should support this, not needed for Tcl 9.x) | |
804 | # TCL_UTF_MAX=4 - forces a build allowing 4-byte UTF-8 sequences internally. | |
805 | # (Not needed for Tcl 9.x) | |
688 | 806 | # Further, LINKERFLAGS are modified based on above. |
689 | 807 | |
690 | 808 | # Default values for all the above |
727 | 845 | !else |
728 | 846 | !if [nmakehlp -f $(OPTS) "msvcrt"] |
729 | 847 | !message *** Doing msvcrt |
730 | MSVCRT = 1 | |
731 | !else | |
732 | !if !$(STATIC_BUILD) | |
733 | MSVCRT = 1 | |
734 | !else | |
848 | !else | |
849 | !if $(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) < 7 && $(STATIC_BUILD) | |
735 | 850 | MSVCRT = 0 |
736 | 851 | !endif |
737 | 852 | !endif |
740 | 855 | !if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD) |
741 | 856 | !message *** Doing staticpkg |
742 | 857 | TCL_USE_STATIC_PACKAGES = 1 |
743 | !else | |
744 | TCL_USE_STATIC_PACKAGES = 0 | |
745 | 858 | !endif |
746 | 859 | |
747 | 860 | !if [nmakehlp -f $(OPTS) "nothreads"] |
748 | 861 | !message *** Compile explicitly for non-threaded tcl |
749 | 862 | TCL_THREADS = 0 |
750 | 863 | USE_THREAD_ALLOC= 0 |
751 | !else | |
752 | TCL_THREADS = 1 | |
753 | USE_THREAD_ALLOC= 1 | |
754 | !endif | |
755 | ||
864 | !endif | |
865 | ||
866 | !if $(TCL_MAJOR_VERSION) == 8 | |
756 | 867 | !if [nmakehlp -f $(OPTS) "time64bit"] |
757 | 868 | !message *** Force 64-bit time_t |
758 | 869 | _USE_64BIT_TIME_T = 1 |
870 | !endif | |
871 | ||
872 | !if [nmakehlp -f $(OPTS) "utfmax"] | |
873 | !message *** Force allowing 4-byte UTF-8 sequences internally | |
874 | TCL_UTF_MAX = 4 | |
875 | !endif | |
759 | 876 | !endif |
760 | 877 | |
761 | 878 | # Yes, it's weird that the "symbols" option controls DEBUG and |
841 | 958 | !endif |
842 | 959 | |
843 | 960 | ################################################################ |
844 | # 7. Parse the STATS macro to configure code instrumentation | |
961 | # 8. Parse the STATS macro to configure code instrumentation | |
845 | 962 | # The following macros are set by this section: |
846 | 963 | # TCL_MEM_DEBUG - 1 -> enables memory allocation instrumentation |
847 | 964 | # 0 -> disables |
871 | 988 | !endif |
872 | 989 | |
873 | 990 | #################################################################### |
874 | # 8. Parse the CHECKS macro to configure additional compiler checks | |
991 | # 9. Parse the CHECKS macro to configure additional compiler checks | |
875 | 992 | # The following macros are set by this section: |
876 | 993 | # WARNINGS - compiler switches that control the warnings level |
877 | 994 | # TCL_NO_DEPRECATED - 1 -> disable support for deprecated functions |
903 | 1020 | |
904 | 1021 | !endif |
905 | 1022 | |
906 | ################################################################ | |
907 | # 9. Extract various version numbers | |
908 | # For Tcl and Tk, version numbers are extracted from tcl.h and tk.h | |
909 | # respectively. For extensions, versions are extracted from the | |
910 | # configure.in or configure.ac from the TEA configuration if it | |
911 | # exists, and unset otherwise. | |
912 | # Sets the following macros: | |
913 | # TCL_MAJOR_VERSION | |
914 | # TCL_MINOR_VERSION | |
915 | # TCL_PATCH_LEVEL | |
916 | # TCL_VERSION | |
917 | # TK_MAJOR_VERSION | |
918 | # TK_MINOR_VERSION | |
919 | # TK_PATCH_LEVEL | |
920 | # TK_VERSION | |
921 | # DOTVERSION - set as (for example) 2.5 | |
922 | # VERSION - set as (for example 25) | |
923 | #-------------------------------------------------------------- | |
924 | ||
925 | !if [echo REM = This file is generated from rules.vc > versions.vc] | |
926 | !endif | |
927 | !if [echo TCL_MAJOR_VERSION = \>> versions.vc] \ | |
928 | && [nmakehlp -V "$(_TCL_H)" TCL_MAJOR_VERSION >> versions.vc] | |
929 | !endif | |
930 | !if [echo TCL_MINOR_VERSION = \>> versions.vc] \ | |
931 | && [nmakehlp -V "$(_TCL_H)" TCL_MINOR_VERSION >> versions.vc] | |
932 | !endif | |
933 | !if [echo TCL_PATCH_LEVEL = \>> versions.vc] \ | |
934 | && [nmakehlp -V "$(_TCL_H)" TCL_PATCH_LEVEL >> versions.vc] | |
935 | !endif | |
936 | ||
937 | !if defined(_TK_H) | |
938 | !if [echo TK_MAJOR_VERSION = \>> versions.vc] \ | |
939 | && [nmakehlp -V $(_TK_H) TK_MAJOR_VERSION >> versions.vc] | |
940 | !endif | |
941 | !if [echo TK_MINOR_VERSION = \>> versions.vc] \ | |
942 | && [nmakehlp -V $(_TK_H) TK_MINOR_VERSION >> versions.vc] | |
943 | !endif | |
944 | !if [echo TK_PATCH_LEVEL = \>> versions.vc] \ | |
945 | && [nmakehlp -V $(_TK_H) TK_PATCH_LEVEL >> versions.vc] | |
946 | !endif | |
947 | !endif # _TK_H | |
948 | ||
949 | !include versions.vc | |
950 | ||
951 | TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION) | |
952 | TCL_DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) | |
953 | !if defined(_TK_H) | |
954 | TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION) | |
955 | TK_DOTVERSION = $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) | |
956 | !endif | |
957 | ||
958 | # Set DOTVERSION and VERSION | |
959 | !if $(DOING_TCL) | |
960 | ||
961 | DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) | |
962 | VERSION = $(TCL_VERSION) | |
963 | ||
964 | !elseif $(DOING_TK) | |
965 | ||
966 | DOTVERSION = $(TK_DOTVERSION) | |
967 | VERSION = $(TK_VERSION) | |
968 | ||
969 | !else # Doing a non-Tk extension | |
970 | ||
971 | # If parent makefile has not defined DOTVERSION, try to get it from TEA | |
972 | # first from a configure.in file, and then from configure.ac | |
973 | !ifndef DOTVERSION | |
974 | !if [echo DOTVERSION = \> versions.vc] \ | |
975 | || [nmakehlp -V $(ROOT)\configure.in ^[$(PROJECT)^] >> versions.vc] | |
976 | !if [echo DOTVERSION = \> versions.vc] \ | |
977 | || [nmakehlp -V $(ROOT)\configure.ac ^[$(PROJECT)^] >> versions.vc] | |
978 | !error *** Could not figure out extension version. Please define DOTVERSION in parent makefile before including rules.vc. | |
979 | !endif | |
980 | !endif | |
981 | !include versions.vc | |
982 | !endif # DOTVERSION | |
983 | VERSION = $(DOTVERSION:.=) | |
984 | ||
985 | !endif # $(DOING_TCL) ... etc. | |
986 | 1023 | |
987 | 1024 | ################################################################ |
988 | 1025 | # 10. Construct output directory and file paths |
1028 | 1065 | BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) |
1029 | 1066 | !endif |
1030 | 1067 | |
1031 | !if !$(DEBUG) || $(DEBUG) && $(UNCHECKED) | |
1068 | !if !$(DEBUG) || $(TCL_VERSION) > 86 || $(DEBUG) && $(UNCHECKED) | |
1032 | 1069 | SUFX = $(SUFX:g=) |
1033 | 1070 | !endif |
1034 | 1071 | |
1079 | 1116 | # The name of the stubs library for the project being built |
1080 | 1117 | STUBPREFIX = $(PROJECT)stub |
1081 | 1118 | |
1119 | # | |
1082 | 1120 | # Set up paths to various Tcl executables and libraries needed by extensions |
1121 | # | |
1122 | ||
1123 | # TIP 430. Unused for 8.6 but no harm defining it to allow a common rules.vc | |
1124 | !if "$(TCL_PATCH_LETTER)" == "." | |
1125 | TCLSCRIPTZIPNAME = libtcl_$(TCL_MAJOR_VERSION)_$(TCL_MINOR_VERSION)_$(TCL_RELEASE_SERIAL).zip | |
1126 | !else | |
1127 | TCLSCRIPTZIPNAME = libtcl_$(TCL_MAJOR_VERSION)_$(TCL_MINOR_VERSION)_$(TCL_PATCH_LETTER)$(TCL_RELEASE_SERIAL).zip | |
1128 | !endif | |
1129 | !if "$(TK_PATCH_LETTER)" == "." | |
1130 | TKSCRIPTZIPNAME = libtk_$(TK_MAJOR_VERSION)_$(TK_MINOR_VERSION)_$(TK_RELEASE_SERIAL).zip | |
1131 | !else | |
1132 | TKSCRIPTZIPNAME = libtk_$(TK_MAJOR_VERSION)_$(TK_MINOR_VERSION)_$(TK_PATCH_LETTER)$(TK_RELEASE_SERIAL).zip | |
1133 | !endif | |
1134 | ||
1083 | 1135 | !if $(DOING_TCL) |
1084 | ||
1085 | 1136 | TCLSHNAME = $(PROJECT)sh$(VERSION)$(SUFX).exe |
1086 | 1137 | TCLSH = $(OUT_DIR)\$(TCLSHNAME) |
1087 | 1138 | TCLIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib |
1088 | 1139 | TCLLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT) |
1089 | 1140 | TCLLIB = $(OUT_DIR)\$(TCLLIBNAME) |
1141 | TCLSCRIPTZIP = $(OUT_DIR)\$(TCLSCRIPTZIPNAME) | |
1090 | 1142 | |
1091 | 1143 | TCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib |
1092 | 1144 | TCLSTUBLIB = $(OUT_DIR)\$(TCLSTUBLIBNAME) |
1093 | 1145 | TCL_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" |
1094 | 1146 | |
1095 | !else # ! $(DOING_TCL) | |
1147 | !else # !$(DOING_TCL) | |
1096 | 1148 | |
1097 | 1149 | !if $(TCLINSTALL) # Building against an installed Tcl |
1098 | 1150 | |
1114 | 1166 | TCL_LIBRARY = $(_TCLDIR)\lib |
1115 | 1167 | TCLREGLIB = $(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib |
1116 | 1168 | TCLDDELIB = $(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib |
1169 | TCLSCRIPTZIP = $(_TCLDIR)\lib\$(TCLSCRIPTZIPNAME) | |
1117 | 1170 | TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target |
1118 | 1171 | TCL_INCLUDES = -I"$(_TCLDIR)\include" |
1119 | 1172 | |
1133 | 1186 | TCL_LIBRARY = $(_TCLDIR)\library |
1134 | 1187 | TCLREGLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib |
1135 | 1188 | TCLDDELIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib |
1189 | TCLSCRIPTZIP = $(_TCLDIR)\win\$(BUILDDIRTOP)\$(TCLSCRIPTZIPNAME) | |
1136 | 1190 | TCLTOOLSDIR = $(_TCLDIR)\tools |
1137 | 1191 | TCL_INCLUDES = -I"$(_TCLDIR)\generic" -I"$(_TCLDIR)\win" |
1138 | 1192 | |
1165 | 1219 | TKSTUBLIB = $(OUT_DIR)\$(TKSTUBLIBNAME) |
1166 | 1220 | TKIMPLIB = $(OUT_DIR)\$(TKIMPLIBNAME) |
1167 | 1221 | TKLIB = $(OUT_DIR)\$(TKLIBNAME) |
1168 | TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" | |
1222 | TK_INCLUDES = -I"$(WIN_DIR)" -I"$(GENERICDIR)" | |
1223 | TKSCRIPTZIP = $(OUT_DIR)\$(TKSCRIPTZIPNAME) | |
1169 | 1224 | |
1170 | 1225 | !else # effectively NEED_TK |
1171 | 1226 | |
1180 | 1235 | TKIMPLIB = $(_TKDIR)\lib\$(TKIMPLIBNAME) |
1181 | 1236 | !endif |
1182 | 1237 | TK_INCLUDES = -I"$(_TKDIR)\include" |
1238 | TKSCRIPTZIP = $(_TKDIR)\lib\$(TKSCRIPTZIPNAME) | |
1239 | ||
1183 | 1240 | !else # Building against Tk sources |
1241 | ||
1184 | 1242 | WISH = $(_TKDIR)\win\$(BUILDDIRTOP)\$(WISHNAME) |
1185 | 1243 | TKSTUBLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSTUBLIBNAME) |
1186 | 1244 | TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) |
1191 | 1249 | TKIMPLIB = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKIMPLIBNAME) |
1192 | 1250 | !endif |
1193 | 1251 | TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib" |
1252 | TKSCRIPTZIP = $(_TKDIR)\win\$(BUILDDIRTOP)\$(TKSCRIPTZIPNAME) | |
1253 | ||
1194 | 1254 | !endif # TKINSTALL |
1255 | ||
1195 | 1256 | tklibs = "$(TKSTUBLIB)" "$(TKIMPLIB)" |
1196 | 1257 | |
1197 | 1258 | !endif # $(DOING_TK) |
1232 | 1293 | DOC_INSTALL_DIR = $(_INSTALLDIR)\doc |
1233 | 1294 | !if $(DOING_TCL) |
1234 | 1295 | SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION) |
1296 | MODULE_INSTALL_DIR = $(_INSTALLDIR)\lib\tcl$(TCL_MAJOR_VERSION) | |
1235 | 1297 | !else # DOING_TK |
1236 | 1298 | SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_MAJOR_VERSION).$(TK_MINOR_VERSION) |
1237 | 1299 | !endif |
1276 | 1338 | # baselibs - minimum Windows libraries required. Parent makefile can |
1277 | 1339 | # define PRJ_LIBS before including rules.rc if additional libs are needed |
1278 | 1340 | |
1279 | OPTDEFINES = /DTCL_CFGVAL_ENCODING=$(CFG_ENCODING) /DSTDC_HEADERS | |
1341 | OPTDEFINES = /DSTDC_HEADERS | |
1342 | !if $(VCVERSION) > 1600 | |
1343 | OPTDEFINES = $(OPTDEFINES) /DHAVE_STDINT_H=1 | |
1344 | !else | |
1345 | OPTDEFINES = $(OPTDEFINES) /DMP_NO_STDINT=1 | |
1346 | !endif | |
1347 | !if $(VCVERSION) >= 1800 | |
1348 | OPTDEFINES = $(OPTDEFINES) /DHAVE_INTTYPES_H=1 /DHAVE_STDBOOL_H=1 | |
1349 | !endif | |
1280 | 1350 | |
1281 | 1351 | !if $(TCL_MEM_DEBUG) |
1282 | 1352 | OPTDEFINES = $(OPTDEFINES) /DTCL_MEM_DEBUG |
1292 | 1362 | !endif |
1293 | 1363 | !if $(STATIC_BUILD) |
1294 | 1364 | OPTDEFINES = $(OPTDEFINES) /DSTATIC_BUILD |
1365 | !elseif $(TCL_VERSION) > 86 | |
1366 | OPTDEFINES = $(OPTDEFINES) /DTCL_WITH_EXTERNAL_TOMMATH | |
1367 | !if "$(MACHINE)" == "AMD64" | |
1368 | OPTDEFINES = $(OPTDEFINES) /DMP_64BIT | |
1369 | !endif | |
1295 | 1370 | !endif |
1296 | 1371 | !if $(TCL_NO_DEPRECATED) |
1297 | 1372 | OPTDEFINES = $(OPTDEFINES) /DTCL_NO_DEPRECATED |
1300 | 1375 | !if $(USE_STUBS) |
1301 | 1376 | # Note we do not define USE_TCL_STUBS even when building tk since some |
1302 | 1377 | # test targets in tk do not use stubs |
1303 | !if ! $(DOING_TCL) | |
1378 | !if !$(DOING_TCL) | |
1304 | 1379 | USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS |
1305 | 1380 | !if $(NEED_TK) |
1306 | 1381 | USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS |
1321 | 1396 | OPTDEFINES = $(OPTDEFINES) /DTCL_CFG_DO64BIT |
1322 | 1397 | !endif |
1323 | 1398 | !if $(VCVERSION) < 1300 |
1324 | OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64 | |
1325 | !endif | |
1326 | ||
1399 | OPTDEFINES = $(OPTDEFINES) /DNO_STRTOI64=1 | |
1400 | !endif | |
1401 | ||
1402 | !if "$(TCL_MAJOR_VERSION)" == "8" | |
1327 | 1403 | !if "$(_USE_64BIT_TIME_T)" == "1" |
1328 | OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T | |
1404 | OPTDEFINES = $(OPTDEFINES) /D_USE_64BIT_TIME_T=1 | |
1405 | !endif | |
1406 | !if "$(TCL_UTF_MAX)" == "4" | |
1407 | OPTDEFINES = $(OPTDEFINES) /DTCL_UTF_MAX=4 | |
1329 | 1408 | !endif |
1330 | 1409 | |
1331 | 1410 | # _ATL_XP_TARGETING - Newer SDK's need this to build for XP |
1332 | 1411 | COMPILERFLAGS = /D_ATL_XP_TARGETING |
1412 | !endif | |
1333 | 1413 | |
1334 | 1414 | # Like the TEA system only set this non empty for non-Tk extensions |
1335 | 1415 | # Note: some extensions use PACKAGE_NAME and others use PACKAGE_TCLNAME |
1454 | 1534 | lflags = $(lflags) -nodefaultlib:libucrt.lib |
1455 | 1535 | !endif |
1456 | 1536 | |
1457 | # Old linkers (Visual C++ 6 in particular) will link for fast loading | |
1458 | # on Win98. Since we do not support Win98 any more, we specify nowin98 | |
1459 | # as recommended for NT and later. However, this is only required by | |
1460 | # IX86 on older compilers and only needed if we are not doing a static build. | |
1461 | ||
1462 | !if "$(MACHINE)" == "IX86" && !$(STATIC_BUILD) | |
1463 | !if [nmakehlp -l -opt:nowin98 $(LINKER_TESTFLAGS)] | |
1464 | # Align sections for PE size savings. | |
1465 | lflags = $(lflags) -opt:nowin98 | |
1466 | !endif | |
1467 | !endif | |
1468 | ||
1469 | 1537 | dlllflags = $(lflags) -dll |
1470 | 1538 | conlflags = $(lflags) -subsystem:console |
1471 | 1539 | guilflags = $(lflags) -subsystem:windows |
1507 | 1575 | RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \ |
1508 | 1576 | $(TCL_INCLUDES) \ |
1509 | 1577 | /DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \ |
1510 | /DCOMMAVERSION=$(DOTVERSION:.=,),0 \ | |
1578 | /DCOMMAVERSION=$(RCCOMMAVERSION) \ | |
1511 | 1579 | /DDOTVERSION=\"$(DOTVERSION)\" \ |
1512 | 1580 | /DVERSION=\"$(VERSION)\" \ |
1513 | 1581 | /DSUFX=\"$(SUFX)\" \ |
1523 | 1591 | !if $(MULTIPLATFORM_INSTALL) |
1524 | 1592 | default-pkgindex: |
1525 | 1593 | @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ |
1526 | [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME)]] > $(OUT_DIR)\pkgIndex.tcl | |
1594 | [list load [file join $$dir $(PLATFORM_IDENTIFY) $(PRJLIBNAME)] [string totitle $(PRJ_PACKAGE_TCLNAME)]] > $(OUT_DIR)\pkgIndex.tcl | |
1527 | 1595 | !else |
1528 | 1596 | default-pkgindex: |
1529 | 1597 | @echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \ |
1530 | [list load [file join $$dir $(PRJLIBNAME)]] > $(OUT_DIR)\pkgIndex.tcl | |
1598 | [list load [file join $$dir $(PRJLIBNAME)] [string totitle $(PRJ_PACKAGE_TCLNAME)]] > $(OUT_DIR)\pkgIndex.tcl | |
1531 | 1599 | !endif |
1532 | 1600 | |
1533 | 1601 | default-pkgindex-tea: |
1572 | 1640 | @echo Installing PDBs to '$(LIB_INSTALL_DIR)' |
1573 | 1641 | @if not exist "$(LIB_INSTALL_DIR)" mkdir "$(LIB_INSTALL_DIR)" |
1574 | 1642 | @$(CPY) "$(OUT_DIR)\*.pdb" "$(LIB_INSTALL_DIR)\" |
1643 | ||
1644 | # "emacs font-lock highlighting fix | |
1575 | 1645 | |
1576 | 1646 | default-install-docs-html: |
1577 | 1647 | @echo Installing documentation files to '$(DOC_INSTALL_DIR)' |
1635 | 1705 | !ifdef RCFILE |
1636 | 1706 | |
1637 | 1707 | # Note: don't use $** in below rule because there may be other dependencies |
1638 | # and only the "master" rc must be passed to the resource compiler | |
1708 | # and only the "main" rc must be passed to the resource compiler | |
1639 | 1709 | $(TMP_DIR)\$(PROJECT).res: $(RCDIR)\$(PROJECT).rc |
1640 | 1710 | $(RESCMD) $(RCDIR)\$(PROJECT).rc |
1641 | 1711 | |
1689 | 1759 | |
1690 | 1760 | !if !$(DISABLE_IMPLICIT_RULES) |
1691 | 1761 | # Implicit rule definitions - only for building library objects. For stubs and |
1692 | # main application, the master makefile should define explicit rules. | |
1762 | # main application, the makefile should define explicit rules. | |
1693 | 1763 | |
1694 | 1764 | {$(ROOT)}.c{$(TMP_DIR)}.obj:: |
1695 | 1765 | $(CCPKGCMD) @<< |
1730 | 1800 | # When building an extension, certain configuration options should |
1731 | 1801 | # match the ones used when Tcl was built. Here we check and |
1732 | 1802 | # warn on a mismatch. |
1733 | !if ! $(DOING_TCL) | |
1803 | !if !$(DOING_TCL) | |
1734 | 1804 | |
1735 | 1805 | !if $(TCLINSTALL) # Building against an installed Tcl |
1736 | 1806 | !if exist("$(_TCLDIR)\lib\nmake\tcl.nmake") |
1737 | 1807 | TCLNMAKECONFIG = "$(_TCLDIR)\lib\nmake\tcl.nmake" |
1738 | 1808 | !endif |
1739 | !else # ! $(TCLINSTALL) - building against Tcl source | |
1740 | !if exist("$(OUT_DIR)\tcl.nmake") | |
1741 | TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake" | |
1809 | !else # !$(TCLINSTALL) - building against Tcl source | |
1810 | !if exist("$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake") | |
1811 | TCLNMAKECONFIG = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl.nmake" | |
1742 | 1812 | !endif |
1743 | 1813 | !endif # TCLINSTALL |
1744 | 1814 | |
1759 | 1829 | |
1760 | 1830 | !endif # TCLNMAKECONFIG |
1761 | 1831 | |
1762 | !endif # ! $(DOING_TCL) | |
1832 | !endif # !$(DOING_TCL) | |
1763 | 1833 | |
1764 | 1834 | |
1765 | 1835 | #---------------------------------------------------------- |
3 | 3 | # Part of the nmake based build system for Tcl and its extensions. |
4 | 4 | # This file defines some standard targets for the convenience of extensions |
5 | 5 | # and can be optionally included by the extension makefile. |
6 | # See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for docs. | |
6 | # See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs. | |
7 | 7 | |
8 | 8 | $(PROJECT): setup pkgindex $(PRJLIB) |
9 | 9 |