diff options
Diffstat (limited to 'itcl/itcl')
56 files changed, 7041 insertions, 768 deletions
diff --git a/itcl/itcl/Makefile.in b/itcl/itcl/Makefile.in new file mode 100644 index 00000000000..1fb42d93e0c --- /dev/null +++ b/itcl/itcl/Makefile.in @@ -0,0 +1,493 @@ +# Makefile.in -- +# +# This file is a Makefile for Sample TEA Extension. If it has the name +# "Makefile.in" then it is a template for a Makefile; to generate the +# actual Makefile, run "./configure", which is a configuration script +# generated by the "autoconf" program (constructs like "@foo@" will get +# replaced in the actual Makefile. +# +# Copyright (c) 1999 Scriptics Corporation. +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id$ + +#======================================================================== +# Edit the following few lines when writing a new extension +#======================================================================== + +#======================================================================== +# Change the name of the variable "exampleA_LIB_FILE" to match the one +# used in the configure script. This is the parameterized name of the +# library that we are building. +#======================================================================== + +lib_BINARIES=$(itcl_LIB_FILE) $(itclstub_LIB_FILE) +BINARIES=$(lib_BINARIES) + +#======================================================================== +# Enumerate the names of the source files included in this package. +# This will be used when a dist target is added to the Makefile. +#======================================================================== + +WIN_DIR=$(srcdir)/win +UNIX_DIR=$(srcdir)/unix +GENERIC_DIR=$(srcdir)/generic +PLATFORM_DIR=@PLATFORM_DIR@ + +WIN_SOURCES=$(PLATFORM_DIR)/tclAppInit.c \ + $(PLATFORM_DIR)/dllEntryPoint.c +UNIX_SOURCES=$(PLATFORM_DIR)/tclAppInit.c +GENERIC_SOURCES = $(GENERIC_DIR)/itclStubInit.c \ + $(GENERIC_DIR)/itclStubLib.c \ + $(GENERIC_DIR)/itcl_bicmds.c \ + $(GENERIC_DIR)/itcl_class.c \ + $(GENERIC_DIR)/itcl_cmds.c \ + $(GENERIC_DIR)/itcl_ensemble.c \ + $(GENERIC_DIR)/itcl_linkage.c \ + $(GENERIC_DIR)/itcl_methods.c \ + $(GENERIC_DIR)/itcl_migrate.c \ + $(GENERIC_DIR)/itcl_objects.c \ + $(GENERIC_DIR)/itcl_obsolete.c \ + $(GENERIC_DIR)/itcl_parse.c \ + $(GENERIC_DIR)/itcl_util.c +PLATFORM_SOURCES = @PLATFORM_SOURCES@ +itcl_SOURCES = $(PLATFORM_SOURCES) $(GENERIC_SOURCES) +SOURCES = $(itcl_SOURCES) + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +#======================================================================== + +WIN_OBJECTS = dllEntryPoint.$(OBJEXT) +UNIX_OBJECTS = +GENERIC_OBJECTS = itclStubInit.$(OBJEXT) \ + itcl_bicmds.$(OBJEXT) \ + itcl_class.$(OBJEXT) \ + itcl_cmds.$(OBJEXT) \ + itcl_ensemble.$(OBJEXT) \ + itcl_linkage.$(OBJEXT) \ + itcl_methods.$(OBJEXT) \ + itcl_migrate.$(OBJEXT) \ + itcl_objects.$(OBJEXT) \ + itcl_obsolete.$(OBJEXT) \ + itcl_parse.$(OBJEXT) \ + itcl_util.$(OBJEXT) +PLATFORM_OBJECTS = @PLATFORM_OBJECTS@ +itclstub_OBJECTS = itclStubLib.$(OBJEXT) +itcl_OBJECTS = $(PLATFORM_OBJECTS) $(GENERIC_OBJECTS) +OBJECTS = $(itcl_OBJECTS) $(itclstub_OBJECTS) + +#======================================================================== +# The substitution of "exampleA_LIB_FILE" into the variable name below +# let's us refer to the objects for the library without knowing the name +# of the library in advance. It also lets us use the "$@" variable in +# the rule for building the library, so we can refer to both the list of +# objects and the library itself in a platform-independent manner. +#======================================================================== + +itcl_LIB_FILE = @itcl_LIB_FILE@ +@itcl_LIB_FILE@_OBJECTS = $(itcl_OBJECTS) + +itclstub_LIB_FILE = @itclstub_LIB_FILE@ +@itclstub_LIB_FILE@_OBJECTS = $(itclstub_OBJECTS) + +#======================================================================== +# This is a list of header files to be installed +# itk.h includes itclInt.h, which needs itclIntDecls.h, so we must install them. +#======================================================================== + +GENERIC_HDRS= \ + $(srcdir)/generic/itcl.h \ + $(srcdir)/generic/itclDecls.h \ + $(srcdir)/generic/itclInt.h \ + $(srcdir)/generic/itclIntDecls.h + +#======================================================================== +# Add additional lines to handle any additional AC_SUBST cases that +# have been added to the configure script. +#======================================================================== + +SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@ + +# CYGNUS LOCAL +ITCL_LIBRARY = @datadir@/itcl$(VERSION) +# END CYGNUS LOCAL + +ITCL_GENERIC_DIR_NATIVE = @ITCL_GENERIC_DIR_NATIVE@ +ITCL_UNIX_DIR_NATIVE = @ITCL_UNIX_DIR_NATIVE@ +ITCL_WIN_DIR_NATIVE = @ITCL_WIN_DIR_NATIVE@ + +#======================================================================== +# Nothing of the variables below this line need to be changed. Please +# check the TARGETS section below to make sure the make targets are +# correct. +#======================================================================== + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@@VERSION@ +pkglibdir = $(libdir)/@PACKAGE@@VERSION@ +pkgincludedir = $(includedir)/@PACKAGE@@VERSION@ + +top_builddir = . + +# CYGNUS LOCAL +INSTALL = @INSTALL@ +# END CYGNUS LOCAL +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_FLAG = +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +CC = @CC@ +CFLAGS_DEBUG = @CFLAGS_DEBUG@ +CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ +CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ +CLEANFILES = @CLEANFILES@ +EXEEXT = @EXEEXT@ +LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ +LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ +LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ +MAKE_LIB = @MAKE_LIB@ +MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ +MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ +OBJEXT = @OBJEXT@ +RANLIB = @RANLIB@ +SHLIB_CFLAGS = @SHLIB_CFLAGS@ +SHLIB_LD = @SHLIB_LD@ +SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ +SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ +STLIB_LD = @STLIB_LD@ +TCL_BIN_DIR = @TCL_BIN_DIR@ +TCL_DEFS = @TCL_DEFS@ +TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ +TCL_LD_FLAGS = @TCL_LD_FLAGS@ +TCL_LIBS = @TCL_LIBS@ +TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ +TCL_SRC_DIR = @TCL_SRC_DIR@ +TCL_DBGX = @TCL_DBGX@ +TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ +TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ +TCL_TOOL_DIR_NATIVE = @TCL_TOOL_DIR_NATIVE@ +TCL_TOP_DIR_NATIVE = @TCL_TOP_DIR_NATIVE@ +TCL_UNIX_DIR_NATIVE = @TCL_UNIX_DIR_NATIVE@ +TCL_WIN_DIR_NATIVE = @TCL_WIN_DIR_NATIVE@ +INCLUDE_DIR_NATIVE = @INCLUDE_DIR_NATIVE@ +TCL_BMAP_DIR_NATIVE = @TCL_BMAP_DIR_NATIVE@ +TCL_PLATFORM_DIR_NATIVE = @TCL_PLATFORM_DIR_NATIVE@ +TCL_GENERIC_DIR_NATIVE = @TCL_GENERIC_DIR_NATIVE@ +TCLSH_PROG = @TCLSH_PROG@ +ITCL_INCLUDES = @ITCL_INCLUDES@ + +AUTOCONF = autoconf + +LDFLAGS = $(LDFLAGS_DEFAULT) + +INCLUDES = @TCL_INCLUDES@ @ITCL_INCLUDES@ + +EXTRA_CFLAGS = $(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) $(NO_DEPRECATED_FLAGS) $(TCL_EXTRA_CFLAGS) + +DEFS = @DEFS@ $(EXTRA_CFLAGS) -DITCL_LIBRARY=\"$(ITCL_LIBRARY)\" + +ACLOCAL_M4 = $(srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../config/mkinstalldirs + +CPPFLAGS = @CPPFLAGS@ +LIBS = @LIBS@ +AR = ar +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ + +#======================================================================== +# Start of user-definable TARGETS section +#======================================================================== + +#======================================================================== +# TEA TARGETS. Please note that the "libraries:" target refers to platform +# independent files, and the "binaries:" target inclues executable programs and +# platform-dependent libraries. Modify these targets so that they install +# the various pieces of your package. The make and install rules +# for the BINARIES that you specified above have already been done. +#======================================================================== + +all: binaries libraries doc + +#======================================================================== +# The binaries target builds executable programs, Windows .dll's, unix +# shared/static libraries, and any other platform-dependent files. +# The list of targets to build for "binaries:" is specified at the top +# of the Makefile, in the "BINARIES" variable. +#======================================================================== + +binaries: $(BINARIES) + +libraries: + +doc: + +install: all install-binaries install-libraries install-doc + +install-binaries: binaries install-lib-binaries install-bin-binaries + +#======================================================================== +# This rule installs platform-independent files, such as header files. +#======================================================================== + +install-libraries: libraries + $(mkinstalldirs) $(includedir) + @echo "Installing header files in $(includedir)" + @for i in $(GENERIC_HDRS) ; do \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(includedir) ; \ + done; + @echo "Installing library files in $(ITCL_LIBRARY)" + @for i in $(srcdir)/library/*.tcl ; do \ + echo "Installing $$i" ; \ + $(INSTALL_DATA) $$i $(ITCL_LIBRARY) ; \ + done; + +#======================================================================== +# Install documentation. Unix manpages should go in the $(mandir) +# directory. +#======================================================================== + +install-doc: doc + $(mkinstalldirs) $(mandir)/mann + @echo "Installing man pages in $(mandir)" + @for i in $(srcdir)/doc/*.n; \ + do \ + echo "Installing $$i"; \ + $(INSTALL_DATA) $$i $(mandir)/mann ; \ + done + +test: $(TCLSH_PROG) + $(TCLSH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \ + -exedir `@CYGPATH@ $(bindir)` $(TESTFLAGS) + +depend: + +#======================================================================== +# Enumerate the names of the object files included in this package. +# These objects are created and linked into the final library. In +# most cases these object files will correspond to the source files +# above. +# +# $(exampleA_LIB_FILE) should be listed as part of the BINARIES variable +# at the top of the Makefile. That will ensure that this target is built +# when you run "make binaries". +# +# You shouldn't need to modify this target, except to change the package +# name from "exampleA" to your package's name. +#======================================================================== + +$(itcl_LIB_FILE): $(itcl_OBJECTS) + -rm -f $(itcl_LIB_FILE) + @MAKE_LIB@ + @POST_MAKE_LIB@ + +$(itclstub_LIB_FILE): $(itclstub_OBJECTS) + -rm -f $(itclstub_LIB_FILE) + @MAKE_STATIC_LIB@ + @POST_MAKE_STATIC_LIB@ + +#======================================================================== +# We need to enumerate the list of .c to .o lines here. +# Unfortunately, there does not seem to be any other way to do this +# in a Makefile-independent way. We can't use VPATH because it picks up +# object files that may be located in the source directory. +# +# In the following lines, $(srcdir) refers to the toplevel directory +# containing your extension. If your sources are in a subdirectory, +# you will have to modify the paths to reflect this: +# +# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c +# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@ +#======================================================================== + +dllEntryPoint.$(OBJEXT): $(WIN_DIR)/dllEntryPoint.c + $(COMPILE) -c `@CYGPATH@ $(WIN_DIR)/dllEntryPoint.c` -o $@ + +tclAppInit.$(OBJEXT): $(PLATFORM_DIR)/tclAppInit.c + $(COMPILE) -c `@CYGPATH@ $(PLATFORM_DIR)/tclAppInit.c` -o $@ + +itclStubInit.$(OBJEXT): $(GENERIC_DIR)/itclStubInit.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itclStubInit.c` -o $@ + +itclStubLib.$(OBJEXT): $(GENERIC_DIR)/itclStubLib.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itclStubLib.c` -o $@ + +itcl_bicmds.$(OBJEXT): $(GENERIC_DIR)/itcl_bicmds.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_bicmds.c` -o $@ + +itcl_class.$(OBJEXT): $(GENERIC_DIR)/itcl_class.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_class.c` -o $@ + +itcl_cmds.$(OBJEXT): $(GENERIC_DIR)/itcl_cmds.c Makefile + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_cmds.c` -o $@ + +itcl_ensemble.$(OBJEXT): $(GENERIC_DIR)/itcl_ensemble.c Makefile + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_ensemble.c` -o $@ + +itcl_linkage.$(OBJEXT): $(GENERIC_DIR)/itcl_linkage.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_linkage.c` -o $@ + +itcl_methods.$(OBJEXT): $(GENERIC_DIR)/itcl_methods.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_methods.c` -o $@ + +itcl_migrate.$(OBJEXT): $(GENERIC_DIR)/itcl_migrate.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_migrate.c` -o $@ + +itcl_objects.$(OBJEXT): $(GENERIC_DIR)/itcl_objects.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_objects.c` -o $@ + +itcl_obsolete.$(OBJEXT): $(GENERIC_DIR)/itcl_obsolete.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_obsolete.c` -o $@ + +itcl_parse.$(OBJEXT): $(GENERIC_DIR)/itcl_parse.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_parse.c` -o $@ + +itcl_util.$(OBJEXT): $(GENERIC_DIR)/itcl_util.c + $(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itcl_util.c` -o $@ + + +#======================================================================== +# End of user-definable section +#======================================================================== + +#======================================================================== +# Don't modify the file to clean here. Instead, set the "CLEANFILES" +# variable in configure.in +#======================================================================== + +clean: + -test -z "$(BINARIES)" || rm -f $(BINARIES) + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean: clean + -rm -f *.tab.c + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f config.status + +#======================================================================== +# Install binary object libraries. On Windows this includes both .dll and +# .lib files. Because the .lib files are not explicitly listed anywhere, +# we need to deduce their existence from the .dll file of the same name. +# Additionally, the .dll files go into the bin directory, but the .lib +# files go into the lib directory. On Unix platforms, all library files +# go into the lib directory. In addition, this will generate the pkgIndex.tcl +# file in the install location (assuming it can find a usable tclsh8.2 shell) +# +# You should not have to modify this target. +#======================================================================== + +install-lib-binaries: installdirs + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + ext=`echo $$p|sed -e "s/.*\.//"`; \ + if test "x$$ext" = "xdll"; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ + lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ + if test -f $$lib; then \ + echo " $(INSTALL_PROGRAM) $$lib $(DESTDIR)$(libdir)/$$lib"; \ + $(INSTALL_PROGRAM) $$lib $(DESTDIR)$(libdir)/$$lib; \ + fi; \ + else \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \ + fi; \ + else :; fi; \ + done + @list='$(lib_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ + $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ + else :; fi; \ + done + $(INSTALL_DATA) pkgIndex.tcl $(pkglibdir) + +#======================================================================== +# Install binary executables (e.g. .exe files) +# +# You should not have to modify this target. +#======================================================================== + +install-bin-binaries: installdirs + @list='$(bin_BINARIES)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \ + else :; fi; \ + done + +.SUFFIXES: .c .o .obj + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +#config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +# $(SHELL) ./config.status --recheck +#$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) +# cd $(srcdir) && $(AUTOCONF) + + +uninstall-binaries: + @$(NORMAL_UNINSTALL) + list='$(BINARIES)'; for p in $$list; do \ + rm -f $(DESTDIR)$(libdir)/$$p; \ + done + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libdir) + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(mkinstalldirs) $(ITCL_LIBRARY) + +.PHONY: all binaries clean depend distclean doc install installdirs \ +libraries test + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/itcl/itcl/aclocal.m4 b/itcl/itcl/aclocal.m4 new file mode 100644 index 00000000000..09bc09fa2b7 --- /dev/null +++ b/itcl/itcl/aclocal.m4 @@ -0,0 +1,2 @@ +builtin(include,../tcl.m4) +builtin(include,../cygtcl.m4) diff --git a/itcl/itcl/configure b/itcl/itcl/configure new file mode 100755 index 00000000000..31c237447c5 --- /dev/null +++ b/itcl/itcl/configure @@ -0,0 +1,2637 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-tcl directory containing tcl configuration (tclConfig.sh)" +ac_help="$ac_help + --enable-threads build with threads" +ac_help="$ac_help + --enable-shared build and link with shared libraries [--enable-shared]" +ac_help="$ac_help + --enable-symbols build with debugging symbols [--disable-symbols]" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +sitefile= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=generic/itcl.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi + fi +else + CONFIG_SITE="$sitefile" +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + +# CYGNUS LOCAL +ac_aux_dir= +for ac_dir in ../.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in ../.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# END CYGNUS LOCAL + +#-------------------------------------------------------------------- +# __CHANGE__ +# Set your package name and version numbers here. The NODOT_VERSION is +# required for constructing the library name on systems that don't like +# dots in library names (Windows). The VERSION variable is used on the +# other systems. +#-------------------------------------------------------------------- + +PACKAGE=itcl + +MAJOR_VERSION=3 +MINOR_VERSION=2 +PATCHLEVEL=.0 + +VERSION=${MAJOR_VERSION}.${MINOR_VERSION} +NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} + + + + + +#-------------------------------------------------------------------- +# We put this here so that you can compile with -DVERSION="1.2" to +# encode the package version directly into the source files. +#-------------------------------------------------------------------- + +eval cat >> confdefs.h <<EOF +#define VERSION "${VERSION}" +EOF + + +#------------------------------------------------------------------------ +# Handle the --prefix=... option +#------------------------------------------------------------------------ + +if test "${prefix}" = "NONE"; then + prefix=/usr/local +fi +if test "${exec_prefix}" = "NONE"; then + exec_prefix=$prefix +fi + +#-------------------------------------------------------------------- +# Check whether --enable-gcc or --disable-gcc was given. Do this +# before AC_CYGWIN is called so the compiler can +# be fully tested by built-in autoconf tools. +# This macro also calls AC_PROG_CC to set the compiler if --enable-gcc +# was not used. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:620: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:650: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:701: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 744 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:775: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:780: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:808: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +# END CYGNUS LOCAL +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:852: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +#-------------------------------------------------------------------- +# Checks to see if the make program sets the $MAKE variable. +#-------------------------------------------------------------------- + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:910: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +#-------------------------------------------------------------------- +# Find ranlib +#-------------------------------------------------------------------- + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:944: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +#-------------------------------------------------------------------- +# This macro performs additional compiler tests. +#-------------------------------------------------------------------- + +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:977: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 982 "configure" +#include "confdefs.h" + +int main() { + +#ifndef __CYGWIN__ +#define __CYGWIN__ __CYGWIN32__ +#endif +return __CYGWIN__; +; return 0; } +EOF +if { (eval echo configure:993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_cygwin" 1>&6 +CYGWIN= +test "$ac_cv_cygwin" = yes && CYGWIN=yes + +#-------------------------------------------------------------------- +# Determines the correct binary file extension (.o, .obj, .exe etc.) +#-------------------------------------------------------------------- + +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1015: checking for object suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftest* +echo 'int i = 1;' > conftest.$ac_ext +if { (eval echo configure:1021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + +echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 +echo "configure:1039: checking for mingw32 environment" >&5 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1044 "configure" +#include "confdefs.h" + +int main() { +return __MINGW32__; +; return 0; } +EOF +if { (eval echo configure:1051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1070: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + + +#-------------------------------------------------------------------- +# "cygpath" is used on windows to generate native path names for include +# files. +# These variables should only be used with the compiler and linker since +# they generate native path names. +# +# Unix tclConfig.sh points SRC_DIR at the top-level directory of +# the Tcl sources, while the Windows tclConfig.sh points SRC_DIR at +# the win subdirectory. Hence the different usages of SRC_DIR below. +# +# This must be done before calling SC_PUBLIC_TCL_HEADERS +# +# RELPATH is used to locate binary extensions relative to the lib directory. +# It is only needed if mkIndex.tcl can't generate an installed pkgIndex.tcl +# file for you. +#-------------------------------------------------------------------- + +case "${host}" in + *mingw32* | *windows32*) + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1123: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CYGPATH="cygpath -w" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" +fi +fi +CYGPATH="$ac_cv_prog_CYGPATH" +if test -n "$CYGPATH"; then + echo "$ac_t""$CYGPATH" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + RELPATH=".. .. bin" + ;; + *) + CYGPATH=echo + RELPATH=.. + ;; +esac + + + + +#-------------------------------------------------------------------- +# Includes for this package +#-------------------------------------------------------------------- + +# CYGNUS LOCAL +srcdir=`cd ${srcdir} ; pwd` +ITCL_SRC_DIR_NATIVE=`${CYGPATH} ${srcdir}` +# END CYGNUS LOCAL +ITCL_GENERIC_DIR_NATIVE=`${CYGPATH} ${srcdir}/generic` +ITCL_WIN_DIR_NATIVE=`${CYGPATH} ${srcdir}/win` +ITCL_UNIX_DIR_NATIVE=`${CYGPATH} ${srcdir}/unix` + +case "${host}" in + *cygwin* | *mingw32* | *windows32*) + ITCL_PLATFORM_DIR_NATIVE=${ITCL_WIN_DIR_NATIVE} + ;; + *) + ITCL_PLATFORM_DIR_NATIVE=${ITCL_UNIX_DIR_NATIVE} + ;; +esac + +ITCL_INCLUDES="-I\"${ITCL_GENERIC_DIR_NATIVE}\" -I\"${ITCL_PLATFORM_DIR_NATIVE}\"" + + + + + + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + # Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig=${withval} +fi + + echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 +echo "configure:1210: checking for Tcl configuration" >&5 + if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + if test -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${prefix}/lib 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + if test -f "$i/win/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/win; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + { echo "configure: error: Can't find Tcl configuration definitions" 1>&2; exit 1; } + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + echo "$ac_t""found $TCL_BIN_DIR/tclConfig.sh" 1>&6 + fi + fi + + + echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 +echo "configure:1288: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 + + if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + echo "$ac_t""loading" 1>&6 + . $TCL_BIN_DIR/tclConfig.sh + else + echo "$ac_t""file not found" 1>&6 + fi + + # + # The eval is required to do the TCL_DBGX substitution in the + # TCL_LIB_FILE variable + # + + eval TCL_LIB_FILE=${TCL_LIB_FILE} + eval TCL_LIB_FLAG=${TCL_LIB_FLAG} + + + + + + + + + + + + + + + + + + +#-------------------------------------------------------------------- +# __CHANGE__ +# Choose which headers you need. Extension authors should try very +# hard to only rely on the Tcl public header files. Internal headers +# contain private data structures and are subject to change without +# notice. +# This must be done AFTER calling SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG +# so that we can extract TCL_SRC_DIR from the config file (in the case +# of private headers +#-------------------------------------------------------------------- + +#SC_PUBLIC_TCL_HEADERS + + echo $ac_n "checking for Tcl private include files""... $ac_c" 1>&6 +echo "configure:1336: checking for Tcl private include files" >&5 + + case "${host}" in + *mingw32* | *windows32*) + TCL_TOP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}`\" + TCL_GENERIC_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/generic`\" + TCL_UNIX_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/unix`\" + TCL_WIN_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/win`\" + TCL_BMAP_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/bitmaps`\" + TCL_TOOL_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/tools`\" + TCL_COMPAT_DIR_NATIVE=\"`${CYGPATH} ${TCL_SRC_DIR}/compat`\" + TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} + ;; + *) + TCL_TOP_DIR_NATIVE='$(TCL_SRC_DIR)' + TCL_GENERIC_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/generic' + TCL_UNIX_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/unix' + TCL_WIN_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/win' + TCL_BMAP_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/bitmaps' + TCL_TOOL_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/tools' + TCL_COMPAT_DIR_NATIVE='$(TCL_TOP_DIR_NATIVE)/compat' + TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} + ;; + esac + + + + + + + + + + TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" + + echo "$ac_t""Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" 1>&6 + + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_itcl in this case) so +# that we create the export library with the dll. See sha1.h on how +# to use this. +# +# Windows creates a few extra files that need to be cleaned up. +# You can add more files to clean if your extension creates any extra +# files. +# +# Define any extra compiler flags in the PACKAGE_CFLAGS variable. +# These will be appended to the current set of compiler flags for +# your system. +#-------------------------------------------------------------------- + +case "${host}" in + *cygwin*| *mingw32* | *windows32*) + cat >> confdefs.h <<\EOF +#define BUILD_itcl 1 +EOF + + CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch" + PLATFORM_SOURCES='$(WIN_SOURCES)' + PLATFORM_OBJECTS='$(WIN_OBJECTS)' + PLATFORM_DIR='$(WIN_DIR)' + ;; + *) + CLEANFILES= + PLATFORM_SOURCES='$(UNIX_SOURCES)' + PLATFORM_OBJECTS='$(UNIX_OBJECTS)' + PLATFORM_DIR='$(UNIX_DIR)' + ;; +esac + + + + + + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# So far only Tcl responds to this one. +#-------------------------------------------------------------------- + + + echo $ac_n "checking for building with threads""... $ac_c" 1>&6 +echo "configure:1422: checking for building with threads" >&5 + # Check whether --enable-threads or --disable-threads was given. +if test "${enable_threads+set}" = set; then + enableval="$enable_threads" + tcl_ok=$enableval +else + tcl_ok=no +fi + + + if test "$tcl_ok" = "yes"; then + TCL_THREADS=1 + cat >> confdefs.h <<\EOF +#define TCL_THREADS 1 +EOF + + cat >> confdefs.h <<\EOF +#define _REENTRANT 1 +EOF + + + case "${host}" in + *mingw32* | *windows32*) + echo "$ac_t""yes" 1>&6 + ;; + *) + echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6 +echo "configure:1449: checking for pthread_mutex_init in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lpthread $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1457 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_mutex_init(); + +int main() { +pthread_mutex_init() +; return 0; } +EOF +if { (eval echo configure:1468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + tcl_ok=yes +else + echo "$ac_t""no" 1>&6 +tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthread" + echo "$ac_t""yes" 1>&6 + else + TCL_THREADS=0 + echo "$ac_t""no" 1>&6 + echo "configure: warning: "Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile..."" 1>&2 + fi + ;; + esac + else + TCL_THREADS=0 + echo "$ac_t""no (default)" 1>&6 + fi + + + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + + + echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 +echo "configure:1514: checking how to build libraries" >&5 + # Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + tcl_ok=$enableval +else + tcl_ok=no +fi + + +# CYGNUS LOCAL + case "${host}" in + *mingw32* | *windows32*) + # Default to shared build for Windows + if test "${enable_shared+set}" != set; then + tcl_ok=yes + fi + ;; + esac +# END CYGNUS LOCAL + + if test "$tcl_ok" = "yes" ; then + echo "$ac_t""shared" 1>&6 + SHARED_BUILD=1 + else + echo "$ac_t""static" 1>&6 + SHARED_BUILD=0 + cat >> confdefs.h <<\EOF +#define STATIC_BUILD 1 +EOF + + fi + + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# is all taken from the tclConfig.sh file. +#-------------------------------------------------------------------- + +CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} +CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} +LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} +LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} +SHLIB_LD=${TCL_SHLIB_LD} +STLIB_LD=${TCL_STLIB_LD} +SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} + + + + + + + + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. +#-------------------------------------------------------------------- + + + case "${host}" in + *mingw32* | *windows32*) + tcl_dbgx=d + ;; + *) + tcl_dbgx=g + ;; + esac + + echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 +echo "configure:1585: checking for build with symbols" >&5 + # Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" + tcl_ok=$enableval +else + tcl_ok=no +fi + + if test "$tcl_ok" = "yes"; then + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" + DBGX=${tcl_dbgx} + TCL_DBGX=${tcl_dbgx} + echo "$ac_t""yes" 1>&6 + else + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" + DBGX="" + TCL_DBGX="" + echo "$ac_t""no" 1>&6 + fi + + + + + + +if test "${SHARED_BUILD}" = "1" ; then + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +else + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' +fi + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. +#-------------------------------------------------------------------- + +if test "${SHARED_BUILD}" = "1" ; then + cat >> confdefs.h <<\EOF +#define USE_TCL_STUBS 1 +EOF + +fi + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, +# and SC_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + + + case "${host}" in + *mingw32* | *windows32*) + if test "${CC}" = "cl"; then + MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(\$@_OBJECTS) " + MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\$@ \$(\$@_OBJECTS) " + else + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(\$@_OBJECTS) " + POST_MAKE_STATIC_LIB="\${RANLIB} \$@" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(\$@_OBJECTS) \${SHLIB_LDFLAGS} \$(LDFLAGS) \${SHLIB_LD_LIBS} -Wl,--out-implib,\$(patsubst %.dll,lib%.a,\$@)" + fi + ;; + *) + MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(\$@_OBJECTS)" + POST_MAKE_STATIC_LIB="\${RANLIB} \$@" + MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(\$@_OBJECTS) \${SHLIB_LDFLAGS} \${SHLIB_LD_LIBS}" + ;; + esac + + if test "${SHARED_BUILD}" = "1" ; then + MAKE_LIB=${MAKE_SHARED_LIB} + else + MAKE_LIB=${MAKE_STATIC_LIB} + POST_MAKE_LIB=${POST_MAKE_STATIC_LIB} + fi + + + + + + + + +#-------------------------------------------------------------------- +# eval these two values to dereference the ${DBGX} variable. +#-------------------------------------------------------------------- + +eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" +eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" + +#-------------------------------------------------------------------- +# Shared libraries and static libraries have different names. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL + +if test "${SHARED_BUILD}" = "1" ; then + # FIXME: Need to devise a TCL_TOOL macro to deal with this! + case "${host}" in + *cygwin* | *mingw32* | *windows32*) + SHLIB_LD_LIBS="${TCL_BUILD_STUB_LIB_SPEC} ${TCL_SHLIB_LD_LIBS}" + # Need to link to the .a or .lib not the .dll! + + libname=${PACKAGE} + suffix=${SHARED_LIB_SUFFIX} + + case "${host}" in + *windows32* | *mingw32* | *cygwin*) + eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + *) + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + esac + + eval "long_libname=${long_libname}" + + # Trick to replace DBGX with TCL_DBGX + DBGX='${TCL_DBGX}' + eval "long_libname=${long_libname}" + + ITCL_SHLIB_FILE=$long_libname + + + libname=${PACKAGE} + suffix=${UNSHARED_LIB_SUFFIX} + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + else + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + fi + ;; + *) + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + esac + + eval "long_libname=${long_libname}" + + # Trick to replace DBGX with TCL_DBGX + DBGX='${TCL_DBGX}' + eval "long_libname=${long_libname}" + + ITCL_LIB_FILE=$long_libname + + ITCL_TARGET_FILE=${ITCL_SHLIB_FILE} + ;; + *) + SHLIB_LD_LIBS="${TCL_BUILD_LIB_SPEC}" + + libname=${PACKAGE} + suffix=${SHARED_LIB_SUFFIX} + + case "${host}" in + *windows32* | *mingw32* | *cygwin*) + eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + *) + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + esac + + eval "long_libname=${long_libname}" + + # Trick to replace DBGX with TCL_DBGX + DBGX='${TCL_DBGX}' + eval "long_libname=${long_libname}" + + ITCL_LIB_FILE=$long_libname + + ITCL_TARGET_FILE=${ITCL_LIB_FILE} + ;; + esac +else + + libname=${PACKAGE} + suffix=${UNSHARED_LIB_SUFFIX} + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + else + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + fi + ;; + *) + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + esac + + eval "long_libname=${long_libname}" + + # Trick to replace DBGX with TCL_DBGX + DBGX='${TCL_DBGX}' + eval "long_libname=${long_libname}" + + ITCL_LIB_FILE=$long_libname + + ITCL_TARGET_FILE=${ITCL_LIB_FILE} +fi + + + libname=${PACKAGE}stub + suffix=${UNSHARED_LIB_SUFFIX} + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + eval "long_libname=\"${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + else + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + fi + ;; + *) + eval "long_libname=\"lib${TCL_VENDOR_PREFIX}${libname}${suffix}\"" + ;; + esac + + eval "long_libname=${long_libname}" + + # Trick to replace DBGX with TCL_DBGX + DBGX='${TCL_DBGX}' + eval "long_libname=${long_libname}" + + ITCL_STUB_LIB_FILE=$long_libname + + + + + + + libname=${PACKAGE} + version=${VERSION} + + if test "$TCL_LIB_SUFFIX" = "" ; then + { echo "configure: error: The TCL_LIB_SUFFIX variable is not defined" 1>&2; exit 1; } + fi + + # If the . character is not allowed in lib name, remove it from version + if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then + version=`echo $version | tr -d .` + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\"" + else + short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}" + fi + ;; + *) + short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}" + ;; + esac + + ITCL_LIB_FLAG=$short_libname + + + libname=${PACKAGE}stub + version=${VERSION} + + if test "$TCL_LIB_SUFFIX" = "" ; then + { echo "configure: error: The TCL_LIB_SUFFIX variable is not defined" 1>&2; exit 1; } + fi + + # If the . character is not allowed in lib name, remove it from version + if test "${TCL_LIB_VERSIONS_OK}" != "ok"; then + version=`echo $version | tr -d .` + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + eval "short_libname=\"${TCL_VENDOR_PREFIX}${libname}${version}${TCL_LIB_SUFFIX}\"" + else + short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}${TCL_DBGX}" + fi + ;; + *) + short_libname="-l${TCL_VENDOR_PREFIX}${libname}${version}\${TCL_DBGX}" + ;; + esac + + ITCL_STUB_LIB_FLAG=$short_libname + + + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + + val="`pwd`/${ITCL_LIB_FLAG}" + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable ITCL_BUILD_LIB_SPEC" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + ITCL_BUILD_LIB_SPEC=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + ITCL_BUILD_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + ITCL_BUILD_LIB_SPEC=$val + ;; + esac + + else + + val=`pwd` + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + dirname=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + dirname="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + dirname=$val + ;; + esac + + ITCL_BUILD_LIB_SPEC="-L${dirname} ${ITCL_LIB_FLAG}" + fi + ;; + *) + ITCL_BUILD_LIB_SPEC="-L`pwd` ${ITCL_LIB_FLAG}" + ;; + esac + + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + + val="`pwd`/${ITCL_STUB_LIB_FLAG}" + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable ITCL_BUILD_STUB_LIB_SPEC" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + ITCL_BUILD_STUB_LIB_SPEC=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + ITCL_BUILD_STUB_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + ITCL_BUILD_STUB_LIB_SPEC=$val + ;; + esac + + else + + val=`pwd` + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + dirname=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + dirname="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + dirname=$val + ;; + esac + + ITCL_BUILD_STUB_LIB_SPEC="-L${dirname} ${ITCL_STUB_LIB_FLAG}" + fi + ;; + *) + ITCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${ITCL_STUB_LIB_FLAG}" + ;; + esac + + + + + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + + val="${exec_prefix}/lib/${ITCL_LIB_FLAG}" + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable ITCL_LIB_SPEC" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + ITCL_LIB_SPEC=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + ITCL_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + ITCL_LIB_SPEC=$val + ;; + esac + + else + + val=${exec_prefix}/lib + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + dirname=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + dirname="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + dirname=$val + ;; + esac + + ITCL_LIB_SPEC="-L${dirname} ${ITCL_LIB_FLAG}" + fi + ;; + *) + ITCL_LIB_SPEC="-L${exec_prefix}/lib ${ITCL_LIB_FLAG}" + ;; + esac + + + case "${host}" in + *windows32* | *mingw32*) + if test "$GCC" != yes; then + + val="${exec_prefix}/lib/${ITCL_STUB_LIB_FLAG}" + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable ITCL_STUB_LIB_SPEC" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + ITCL_STUB_LIB_SPEC=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + ITCL_STUB_LIB_SPEC="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + ITCL_STUB_LIB_SPEC=$val + ;; + esac + + else + + val=${exec_prefix}/lib + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable dirname" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + dirname=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + dirname="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + dirname=$val + ;; + esac + + ITCL_STUB_LIB_SPEC="-L${dirname} ${ITCL_STUB_LIB_FLAG}" + fi + ;; + *) + ITCL_STUB_LIB_SPEC="-L${exec_prefix}/lib ${ITCL_STUB_LIB_FLAG}" + ;; + esac + + + + + + + val="`pwd`/${ITCL_LIB_FILE}" + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable ITCL_LIB_FULL_PATH" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + ITCL_LIB_FULL_PATH=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + ITCL_LIB_FULL_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + ITCL_LIB_FULL_PATH=$val + ;; + esac + + + + + val="`pwd`/${ITCL_STUB_LIB_FILE}" + + if test "$val" = "" ; then + { echo "configure: error: Empty value for variable ITCL_STUB_LIB_FULL_PATH" 1>&2; exit 1; } + fi + + case "${host}" in + *windows32* | *mingw32*) + if test "${CYGPATH}" = ""; then + { echo "configure: error: CYGPATH variable is not defined." 1>&2; exit 1; } + elif test "${CYGPATH}" = "echo"; then + # No cygpath when cross compiling + ITCL_STUB_LIB_FULL_PATH=$val + else + # store literal argument text in a variable + val=$val + # Convert Cygwin to Windows path (/tmp/foo -> C:\Tmp\foo) + val="`${CYGPATH} $val`" + # Convert path like C:\Tmp\foo to C:/Tmp/foo + ITCL_STUB_LIB_FULL_PATH="`echo $val | sed -e s#\\\\\\\\#/#g`" + fi + ;; + *) + # Default to a no-op under Unix or Cygwin gcc + ITCL_STUB_LIB_FULL_PATH=$val + ;; + esac + + + + + +itclstub_LIB_FILE=${ITCL_STUB_LIB_FILE} +itcl_LIB_FILE=${ITCL_TARGET_FILE} + +# END CYGNUS LOCAL + +#-------------------------------------------------------------------- +# __CHANGE__ +# Change the name from exampeA_LIB_FILE to match your package name. +# Use the stub_LIB_FILE substitution if your package creates a stub +# library. +#-------------------------------------------------------------------- + + + + + +#-------------------------------------------------------------------- +# Cache the stub library name so that the itk configure script can pick +# it up. +#-------------------------------------------------------------------- + +if eval "test \"`echo '$''{'ac_cv_itclstub_LIB_FILE'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_itclstub_LIB_FILE=${itclstub_LIB_FILE} +fi + + +#-------------------------------------------------------------------- +# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl +# file during the install process. Don't run the TCLSH_PROG through +# ${CYGPATH} because it's being used directly by make. +# Require that we use a tclsh shell version 8.2 or later since earlier +# versions have bugs in the pkg_mkIndex routine. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL +# A Tcl shell is not available when bootstrapping! +# END CYGNUS LOCAL + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL + +# Note: The itclConfig.sh file below is not included in the net release. +# We subst these variables to retain compatibility with the previous +# version of itclConfig.sh. + +ITCL_VERSION=${VERSION} + + +ITCL_MAJOR_VERSION=${MAJOR_VERSION} + + +ITCL_MINOR_VERSION=${MINOR_VERSION} + + +ITCL_RELEASE_LEVEL=${PATCHLEVEL} + + +ITCL_SRC_DIR=${ITCL_SRC_DIR_NATIVE} + + +ITCL_SH=NONE + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile \ + itclConfig.sh \ + pkgIndex.tcl" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@SET_MAKE@%$SET_MAKE%g +s%@RANLIB@%$RANLIB%g +s%@OBJEXT@%$OBJEXT%g +s%@EXEEXT@%$EXEEXT%g +s%@CYGPATH@%$CYGPATH%g +s%@RELPATH@%$RELPATH%g +s%@ITCL_GENERIC_DIR_NATIVE@%$ITCL_GENERIC_DIR_NATIVE%g +s%@ITCL_WIN_DIR_NATIVE@%$ITCL_WIN_DIR_NATIVE%g +s%@ITCL_UNIX_DIR_NATIVE@%$ITCL_UNIX_DIR_NATIVE%g +s%@ITCL_INCLUDES@%$ITCL_INCLUDES%g +s%@TCL_DBGX@%$TCL_DBGX%g +s%@TCL_BIN_DIR@%$TCL_BIN_DIR%g +s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g +s%@TCL_LIB_FILE@%$TCL_LIB_FILE%g +s%@TCL_LIBS@%$TCL_LIBS%g +s%@TCL_DEFS@%$TCL_DEFS%g +s%@TCL_SHLIB_LD_LIBS@%$TCL_SHLIB_LD_LIBS%g +s%@TCL_EXTRA_CFLAGS@%$TCL_EXTRA_CFLAGS%g +s%@TCL_LD_FLAGS@%$TCL_LD_FLAGS%g +s%@TCL_STUB_LIB_FILE@%$TCL_STUB_LIB_FILE%g +s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g +s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g +s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g +s%@TCL_BUILD_STUB_LIB_SPEC@%$TCL_BUILD_STUB_LIB_SPEC%g +s%@TCL_TOP_DIR_NATIVE@%$TCL_TOP_DIR_NATIVE%g +s%@TCL_GENERIC_DIR_NATIVE@%$TCL_GENERIC_DIR_NATIVE%g +s%@TCL_UNIX_DIR_NATIVE@%$TCL_UNIX_DIR_NATIVE%g +s%@TCL_WIN_DIR_NATIVE@%$TCL_WIN_DIR_NATIVE%g +s%@TCL_BMAP_DIR_NATIVE@%$TCL_BMAP_DIR_NATIVE%g +s%@TCL_TOOL_DIR_NATIVE@%$TCL_TOOL_DIR_NATIVE%g +s%@TCL_PLATFORM_DIR_NATIVE@%$TCL_PLATFORM_DIR_NATIVE%g +s%@TCL_INCLUDES@%$TCL_INCLUDES%g +s%@CLEANFILES@%$CLEANFILES%g +s%@PLATFORM_SOURCES@%$PLATFORM_SOURCES%g +s%@PLATFORM_OBJECTS@%$PLATFORM_OBJECTS%g +s%@PLATFORM_DIR@%$PLATFORM_DIR%g +s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g +s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g +s%@STLIB_LD@%$STLIB_LD%g +s%@SHLIB_LD@%$SHLIB_LD%g +s%@SHLIB_CFLAGS@%$SHLIB_CFLAGS%g +s%@SHLIB_LDFLAGS@%$SHLIB_LDFLAGS%g +s%@CFLAGS_DEFAULT@%$CFLAGS_DEFAULT%g +s%@LDFLAGS_DEFAULT@%$LDFLAGS_DEFAULT%g +s%@MAKE_LIB@%$MAKE_LIB%g +s%@MAKE_SHARED_LIB@%$MAKE_SHARED_LIB%g +s%@MAKE_STATIC_LIB@%$MAKE_STATIC_LIB%g +s%@POST_MAKE_LIB@%$POST_MAKE_LIB%g +s%@POST_MAKE_STATIC_LIB@%$POST_MAKE_STATIC_LIB%g +s%@ITCL_LIB_FILE@%$ITCL_LIB_FILE%g +s%@ITCL_STUB_LIB_FILE@%$ITCL_STUB_LIB_FILE%g +s%@ITCL_BUILD_LIB_SPEC@%$ITCL_BUILD_LIB_SPEC%g +s%@ITCL_BUILD_STUB_LIB_SPEC@%$ITCL_BUILD_STUB_LIB_SPEC%g +s%@ITCL_LIB_SPEC@%$ITCL_LIB_SPEC%g +s%@ITCL_STUB_LIB_SPEC@%$ITCL_STUB_LIB_SPEC%g +s%@ITCL_LIB_FULL_PATH@%$ITCL_LIB_FULL_PATH%g +s%@ITCL_STUB_LIB_FULL_PATH@%$ITCL_STUB_LIB_FULL_PATH%g +s%@itclstub_LIB_FILE@%$itclstub_LIB_FILE%g +s%@itcl_LIB_FILE@%$itcl_LIB_FILE%g +s%@SHLIB_LD_LIBS@%$SHLIB_LD_LIBS%g +s%@ITCL_VERSION@%$ITCL_VERSION%g +s%@ITCL_MAJOR_VERSION@%$ITCL_MAJOR_VERSION%g +s%@ITCL_MINOR_VERSION@%$ITCL_MINOR_VERSION%g +s%@ITCL_RELEASE_LEVEL@%$ITCL_RELEASE_LEVEL%g +s%@ITCL_SRC_DIR@%$ITCL_SRC_DIR%g +s%@ITCL_SH@%$ITCL_SH%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile \ + itclConfig.sh \ + pkgIndex.tcl"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + +# END CYGNUS LOCAL diff --git a/itcl/itcl/configure.in b/itcl/itcl/configure.in new file mode 100644 index 00000000000..c33a8ffa904 --- /dev/null +++ b/itcl/itcl/configure.in @@ -0,0 +1,409 @@ +#-------------------------------------------------------------------- +# Sample configure.in for Tcl Extensions. The only places you should +# need to modify this file are marked by the string __CHANGE__ +#-------------------------------------------------------------------- + +#-------------------------------------------------------------------- +# __CHANGE__ +# This very first macro is used to verify that the configure script can +# find the sources. The argument to AC_INIT should be a unique filename +# for this package, and can be a relative path, such as: +# +# AC_INIT(../generic/tcl.h) +#-------------------------------------------------------------------- + +AC_INIT(generic/itcl.h) +# CYGNUS LOCAL +AC_CONFIG_AUX_DIR(../..) +# END CYGNUS LOCAL + +#-------------------------------------------------------------------- +# __CHANGE__ +# Set your package name and version numbers here. The NODOT_VERSION is +# required for constructing the library name on systems that don't like +# dots in library names (Windows). The VERSION variable is used on the +# other systems. +#-------------------------------------------------------------------- + +PACKAGE=itcl + +MAJOR_VERSION=3 +MINOR_VERSION=2 +PATCHLEVEL=.0 + +VERSION=${MAJOR_VERSION}.${MINOR_VERSION} +NODOT_VERSION=${MAJOR_VERSION}${MINOR_VERSION} + + +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) + +#-------------------------------------------------------------------- +# We put this here so that you can compile with -DVERSION="1.2" to +# encode the package version directly into the source files. +#-------------------------------------------------------------------- + +eval AC_DEFINE_UNQUOTED(VERSION, "${VERSION}") + +#------------------------------------------------------------------------ +# Handle the --prefix=... option +#------------------------------------------------------------------------ + +if test "${prefix}" = "NONE"; then + prefix=/usr/local +fi +if test "${exec_prefix}" = "NONE"; then + exec_prefix=$prefix +fi + +#-------------------------------------------------------------------- +# Check whether --enable-gcc or --disable-gcc was given. Do this +# before AC_CYGWIN is called so the compiler can +# be fully tested by built-in autoconf tools. +# This macro also calls AC_PROG_CC to set the compiler if --enable-gcc +# was not used. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL +dnl SC_ENABLE_GCC +AC_PROG_CC +# END CYGNUS LOCAL +AC_PROG_INSTALL + +#-------------------------------------------------------------------- +# Checks to see if the make program sets the $MAKE variable. +#-------------------------------------------------------------------- + +AC_PROG_MAKE_SET + +#-------------------------------------------------------------------- +# Find ranlib +#-------------------------------------------------------------------- + +AC_PROG_RANLIB + +#-------------------------------------------------------------------- +# This macro performs additional compiler tests. +#-------------------------------------------------------------------- + +AC_CYGWIN + +#-------------------------------------------------------------------- +# Determines the correct binary file extension (.o, .obj, .exe etc.) +#-------------------------------------------------------------------- + +AC_OBJEXT +AC_EXEEXT + +#-------------------------------------------------------------------- +# "cygpath" is used on windows to generate native path names for include +# files. +# These variables should only be used with the compiler and linker since +# they generate native path names. +# +# Unix tclConfig.sh points SRC_DIR at the top-level directory of +# the Tcl sources, while the Windows tclConfig.sh points SRC_DIR at +# the win subdirectory. Hence the different usages of SRC_DIR below. +# +# This must be done before calling SC_PUBLIC_TCL_HEADERS +# +# RELPATH is used to locate binary extensions relative to the lib directory. +# It is only needed if mkIndex.tcl can't generate an installed pkgIndex.tcl +# file for you. +#-------------------------------------------------------------------- + +case "${host}" in + *mingw32* | *windows32*) + AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) + RELPATH=".. .. bin" + ;; + *) + CYGPATH=echo + RELPATH=.. + ;; +esac + +AC_SUBST(CYGPATH) +AC_SUBST(RELPATH) + +#-------------------------------------------------------------------- +# Includes for this package +#-------------------------------------------------------------------- + +# CYGNUS LOCAL +srcdir=`cd ${srcdir} ; pwd` +ITCL_SRC_DIR_NATIVE=`${CYGPATH} ${srcdir}` +# END CYGNUS LOCAL +ITCL_GENERIC_DIR_NATIVE=`${CYGPATH} ${srcdir}/generic` +ITCL_WIN_DIR_NATIVE=`${CYGPATH} ${srcdir}/win` +ITCL_UNIX_DIR_NATIVE=`${CYGPATH} ${srcdir}/unix` + +case "${host}" in + *cygwin* | *mingw32* | *windows32*) + ITCL_PLATFORM_DIR_NATIVE=${ITCL_WIN_DIR_NATIVE} + ;; + *) + ITCL_PLATFORM_DIR_NATIVE=${ITCL_UNIX_DIR_NATIVE} + ;; +esac + +ITCL_INCLUDES="-I\"${ITCL_GENERIC_DIR_NATIVE}\" -I\"${ITCL_PLATFORM_DIR_NATIVE}\"" + +AC_SUBST(ITCL_GENERIC_DIR_NATIVE) +AC_SUBST(ITCL_WIN_DIR_NATIVE) +AC_SUBST(ITCL_UNIX_DIR_NATIVE) +AC_SUBST(ITCL_INCLUDES) + +#-------------------------------------------------------------------- +# Load the tclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG +SC_LOAD_TCLCONFIG + +#-------------------------------------------------------------------- +# __CHANGE__ +# Choose which headers you need. Extension authors should try very +# hard to only rely on the Tcl public header files. Internal headers +# contain private data structures and are subject to change without +# notice. +# This must be done AFTER calling SC_PATH_TCLCONFIG/SC_LOAD_TCLCONFIG +# so that we can extract TCL_SRC_DIR from the config file (in the case +# of private headers +#-------------------------------------------------------------------- + +#SC_PUBLIC_TCL_HEADERS +SC_PRIVATE_TCL_HEADERS + +#-------------------------------------------------------------------- +# __CHANGE__ +# A few miscellaneous platform-specific items: +# +# Define a special symbol for Windows (BUILD_itcl in this case) so +# that we create the export library with the dll. See sha1.h on how +# to use this. +# +# Windows creates a few extra files that need to be cleaned up. +# You can add more files to clean if your extension creates any extra +# files. +# +# Define any extra compiler flags in the PACKAGE_CFLAGS variable. +# These will be appended to the current set of compiler flags for +# your system. +#-------------------------------------------------------------------- + +case "${host}" in + *cygwin*| *mingw32* | *windows32*) + AC_DEFINE(BUILD_itcl) + CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc50.pch" + PLATFORM_SOURCES='$(WIN_SOURCES)' + PLATFORM_OBJECTS='$(WIN_OBJECTS)' + PLATFORM_DIR='$(WIN_DIR)' + ;; + *) + CLEANFILES= + PLATFORM_SOURCES='$(UNIX_SOURCES)' + PLATFORM_OBJECTS='$(UNIX_OBJECTS)' + PLATFORM_DIR='$(UNIX_DIR)' + ;; +esac + +AC_SUBST(CLEANFILES) +AC_SUBST(PLATFORM_SOURCES) +AC_SUBST(PLATFORM_OBJECTS) +AC_SUBST(PLATFORM_DIR) + +#-------------------------------------------------------------------- +# Check whether --enable-threads or --disable-threads was given. +# So far only Tcl responds to this one. +#-------------------------------------------------------------------- + +SC_ENABLE_THREADS + +#-------------------------------------------------------------------- +# The statement below defines a collection of symbols related to +# building as a shared library instead of a static library. +#-------------------------------------------------------------------- + +SC_ENABLE_SHARED + +#-------------------------------------------------------------------- +# This macro figures out what flags to use with the compiler/linker +# when building shared/static debug/optimized objects. This information +# is all taken from the tclConfig.sh file. +#-------------------------------------------------------------------- + +CFLAGS_DEBUG=${TCL_CFLAGS_DEBUG} +CFLAGS_OPTIMIZE=${TCL_CFLAGS_OPTIMIZE} +LDFLAGS_DEBUG=${TCL_LDFLAGS_DEBUG} +LDFLAGS_OPTIMIZE=${TCL_LDFLAGS_OPTIMIZE} +SHLIB_LD=${TCL_SHLIB_LD} +STLIB_LD=${TCL_STLIB_LD} +SHLIB_CFLAGS=${TCL_SHLIB_CFLAGS} + +AC_SUBST(CFLAGS_DEBUG) +AC_SUBST(CFLAGS_OPTIMIZE) +AC_SUBST(STLIB_LD) +AC_SUBST(SHLIB_LD) +AC_SUBST(SHLIB_CFLAGS) +AC_SUBST(SHLIB_LDFLAGS) + +#-------------------------------------------------------------------- +# Set the default compiler switches based on the --enable-symbols +# option. +#-------------------------------------------------------------------- + +SC_ENABLE_SYMBOLS + +if test "${SHARED_BUILD}" = "1" ; then + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING} ${SHLIB_CFLAGS}' +else + CFLAGS='${CFLAGS_DEFAULT} ${CFLAGS_WARNING}' +fi + +#-------------------------------------------------------------------- +# Everyone should be linking against the Tcl stub library. If you +# can't for some reason, remove this definition. If you aren't using +# stubs, you also need to modify the SHLIB_LD_LIBS setting below to +# link against the non-stubbed Tcl library. +#-------------------------------------------------------------------- + +if test "${SHARED_BUILD}" = "1" ; then + AC_DEFINE(USE_TCL_STUBS) +fi + +#-------------------------------------------------------------------- +# This macro generates a line to use when building a library. It +# depends on values set by the SC_ENABLE_SHARED, SC_ENABLE_SYMBOLS, +# and SC_LOAD_TCLCONFIG macros above. +#-------------------------------------------------------------------- + +SC_MAKE_LIB + +#-------------------------------------------------------------------- +# eval these two values to dereference the ${DBGX} variable. +#-------------------------------------------------------------------- + +eval "SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" +eval "UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" + +#-------------------------------------------------------------------- +# Shared libraries and static libraries have different names. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL + +if test "${SHARED_BUILD}" = "1" ; then + # FIXME: Need to devise a TCL_TOOL macro to deal with this! + case "${host}" in + *cygwin* | *mingw32* | *windows32*) + SHLIB_LD_LIBS="${TCL_BUILD_STUB_LIB_SPEC} ${TCL_SHLIB_LD_LIBS}" + # Need to link to the .a or .lib not the .dll! + TCL_TOOL_SHARED_LIB_LONGNAME(ITCL_SHLIB_FILE, ${PACKAGE}, ${SHARED_LIB_SUFFIX}) + TCL_TOOL_STATIC_LIB_LONGNAME(ITCL_LIB_FILE, ${PACKAGE}, ${UNSHARED_LIB_SUFFIX}) + ITCL_TARGET_FILE=${ITCL_SHLIB_FILE} + ;; + *) + SHLIB_LD_LIBS="${TCL_BUILD_LIB_SPEC}" + TCL_TOOL_SHARED_LIB_LONGNAME(ITCL_LIB_FILE, ${PACKAGE}, ${SHARED_LIB_SUFFIX}) + ITCL_TARGET_FILE=${ITCL_LIB_FILE} + ;; + esac +else + TCL_TOOL_STATIC_LIB_LONGNAME(ITCL_LIB_FILE, ${PACKAGE}, ${UNSHARED_LIB_SUFFIX}) + ITCL_TARGET_FILE=${ITCL_LIB_FILE} +fi + +TCL_TOOL_STATIC_LIB_LONGNAME(ITCL_STUB_LIB_FILE, ${PACKAGE}stub, ${UNSHARED_LIB_SUFFIX}) + +AC_SUBST(ITCL_LIB_FILE) +AC_SUBST(ITCL_STUB_LIB_FILE) + +TCL_TOOL_LIB_SHORTNAME(ITCL_LIB_FLAG, ${PACKAGE}, ${VERSION}) +TCL_TOOL_LIB_SHORTNAME(ITCL_STUB_LIB_FLAG, ${PACKAGE}stub, ${VERSION}) + +TCL_TOOL_LIB_SPEC(ITCL_BUILD_LIB_SPEC, `pwd`, ${ITCL_LIB_FLAG}) +TCL_TOOL_LIB_SPEC(ITCL_BUILD_STUB_LIB_SPEC, `pwd`, ${ITCL_STUB_LIB_FLAG}) +AC_SUBST(ITCL_BUILD_LIB_SPEC) +AC_SUBST(ITCL_BUILD_STUB_LIB_SPEC) + +TCL_TOOL_LIB_SPEC(ITCL_LIB_SPEC, ${exec_prefix}/lib, ${ITCL_LIB_FLAG}) +TCL_TOOL_LIB_SPEC(ITCL_STUB_LIB_SPEC, ${exec_prefix}/lib, ${ITCL_STUB_LIB_FLAG}) +AC_SUBST(ITCL_LIB_SPEC) +AC_SUBST(ITCL_STUB_LIB_SPEC) + +TCL_TOOL_LIB_PATH(ITCL_LIB_FULL_PATH, `pwd`, ${ITCL_LIB_FILE}) +TCL_TOOL_LIB_PATH(ITCL_STUB_LIB_FULL_PATH, `pwd`, ${ITCL_STUB_LIB_FILE}) +AC_SUBST(ITCL_LIB_FULL_PATH) +AC_SUBST(ITCL_STUB_LIB_FULL_PATH) + +itclstub_LIB_FILE=${ITCL_STUB_LIB_FILE} +itcl_LIB_FILE=${ITCL_TARGET_FILE} + +# END CYGNUS LOCAL + +#-------------------------------------------------------------------- +# __CHANGE__ +# Change the name from exampeA_LIB_FILE to match your package name. +# Use the stub_LIB_FILE substitution if your package creates a stub +# library. +#-------------------------------------------------------------------- + +AC_SUBST(itclstub_LIB_FILE) +AC_SUBST(itcl_LIB_FILE) +AC_SUBST(SHLIB_LD_LIBS) + +#-------------------------------------------------------------------- +# Cache the stub library name so that the itk configure script can pick +# it up. +#-------------------------------------------------------------------- + +AC_CACHE_VAL(ac_cv_itclstub_LIB_FILE, ac_cv_itclstub_LIB_FILE=${itclstub_LIB_FILE}) + +#-------------------------------------------------------------------- +# Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl +# file during the install process. Don't run the TCLSH_PROG through +# ${CYGPATH} because it's being used directly by make. +# Require that we use a tclsh shell version 8.2 or later since earlier +# versions have bugs in the pkg_mkIndex routine. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL +# A Tcl shell is not available when bootstrapping! +dnl SC_PROG_TCLSH +# END CYGNUS LOCAL + +#-------------------------------------------------------------------- +# Finally, substitute all of the various values into the Makefile. +#-------------------------------------------------------------------- + +# CYGNUS LOCAL + +# Note: The itclConfig.sh file below is not included in the net release. +# We subst these variables to retain compatibility with the previous +# version of itclConfig.sh. + +ITCL_VERSION=${VERSION} +AC_SUBST(ITCL_VERSION) + +ITCL_MAJOR_VERSION=${MAJOR_VERSION} +AC_SUBST(ITCL_MAJOR_VERSION) + +ITCL_MINOR_VERSION=${MINOR_VERSION} +AC_SUBST(ITCL_MINOR_VERSION) + +ITCL_RELEASE_LEVEL=${PATCHLEVEL} +AC_SUBST(ITCL_RELEASE_LEVEL) + +ITCL_SRC_DIR=${ITCL_SRC_DIR_NATIVE} +AC_SUBST(ITCL_SRC_DIR) + +ITCL_SH=NONE +AC_SUBST(ITCL_SH) + + +AC_OUTPUT([Makefile \ + itclConfig.sh \ + pkgIndex.tcl]) + +# END CYGNUS LOCAL diff --git a/itcl/itcl/doc/find.n b/itcl/itcl/doc/find.n index 154cfbbf50c..5dfbedacb0e 100644 --- a/itcl/itcl/doc/find.n +++ b/itcl/itcl/doc/find.n @@ -19,34 +19,39 @@ find \- search for classes and objects .SH DESCRIPTION .PP The \fBfind\fR command is used to find classes and objects -that are available in the current context. A class or object is -"available" if its access command can be found in the current -namespace context or in the global namespace. Therefore, -classes and objects created in the global namespace are -available to all other namespaces in a program. Classes and -objects created in one namespace can also be imported into -another using the \fBnamespace import\fR command. +that are available in the current interpreter. Classes and objects +are reported first in the active namespace, then in all other +namespaces in the interpreter. .PP The \fIoption\fR argument determines what action is carried out by the command. The legal \fIoptions\fR (which may be abbreviated) are: .TP \fBfind classes ?\fIpattern\fR? -Returns a list of classes found in the current namespace context. -If the optional \fIpattern\fR is specified, then the reported names -are compared using the rules of the "\fBstring match\fR" command, -and only matching names are reported. +Returns a list of [incr Tcl] classes. Classes in the current +namespace are listed first, followed by classes in all other +namespaces in the interpreter. If the optional \fIpattern\fR +is specified, then the reported names are compared using the rules +of the "\fBstring match\fR" command, and only matching names are +reported. .sp If a class resides in the current namespace context, this command reports its simple name--without any qualifiers. However, if the \fIpattern\fR contains \fB::\fR qualifiers, or if the class resides in another context, this command reports its fully-qualified name. +Therefore, you can use the following command to obtain a list where +all names are fully-qualified: +.CS +find classes ::* +.CE .TP \fBfind objects ?\fIpattern\fR? ?\fB-class \fIclassName\fR? ?\fB-isa \fIclassName\fR? -Returns a list of objects found in the current namespace context. -If the optional \fIpattern\fR is specified, then the reported names -are compared using the rules of the "\fBstring match\fR" command, -and only matching names are reported. +Returns a list of [incr Tcl] objects. Objects in the current +namespace are listed first, followed by objects in all other +namespaces in the interpreter. If the optional \fIpattern\fR is +specified, then the reported names are compared using the rules +of the "\fBstring match\fR" command, and only matching names are +reported. If the optional "\fB-class\fR" parameter is specified, this list is restricted to objects whose most-specific class is \fIclassName\fR. If the optional "\fB-isa\fR" parameter is specified, this list is @@ -57,6 +62,11 @@ If an object resides in the current namespace context, this command reports its simple name--without any qualifiers. However, if the \fIpattern\fR contains \fB::\fR qualifiers, or if the object resides in another context, this command reports its fully-qualified name. +Therefore, you can use the following command to obtain a list where +all names are fully-qualified: +.CS +find objects ::* +.CE .SH KEYWORDS class, object, search, import diff --git a/itcl/itcl/doc/itcl_info.n b/itcl/itcl/doc/itcl_info.n index 083616a3503..454da934788 100644 --- a/itcl/itcl/doc/itcl_info.n +++ b/itcl/itcl/doc/itcl_info.n @@ -22,7 +22,7 @@ itcl_info \- query info regarding classes and objects (obsolete) .PP This command is considered obsolete, but is retained for backward-compatibility with earlier versions of \fB[incr\ Tcl]\fR. -It has been replaced by the "\fBinfo classes\fR" and "\fBinfo objects\fR" +It has been replaced by the "\fBfind classes\fR" and "\fBfind objects\fR" commands, which should be used for any new development. .PP diff --git a/itcl/itcl/doc/scope.n b/itcl/itcl/doc/scope.n index 690a99e7511..f49591e435d 100644 --- a/itcl/itcl/doc/scope.n +++ b/itcl/itcl/doc/scope.n @@ -7,7 +7,7 @@ '\" RCS: $Id$ '\" .so man.macros -.TH scope n "" Tcl "[incr\ Tcl]" +.TH scope n "" itcl "[incr\ Tcl]" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME diff --git a/itcl/itcl/generic/itcl.decls b/itcl/itcl/generic/itcl.decls new file mode 100644 index 00000000000..a644f17c2e2 --- /dev/null +++ b/itcl/itcl/generic/itcl.decls @@ -0,0 +1,111 @@ +# itcl.decls -- +# +# This file contains the declarations for all supported public +# functions that are exported by the Itcl library via the stubs table. +# This file is used to generate the itclDecls.h, itclPlatDecls.h, +# itclStub.c, and itclPlatStub.c files. +# +# +# Copyright (c) 1998-1999 by Scriptics Corporation. +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: $Id$ + +library itcl + +# Define the itcl interface with several sub interfaces: +# itclPlat - platform specific public +# itclInt - generic private +# itclPlatInt - platform specific private + +interface itcl +hooks {itclInt} + +# Declare each of the functions in the public Tcl interface. Note that +# the an index should never be reused for a different function in order +# to preserve backwards compatibility. + +declare 0 generic { + int Itcl_Init(Tcl_Interp *interp) +} +declare 1 generic { + int Itcl_SafeInit(Tcl_Interp *interp) +} +declare 2 generic { + int Itcl_RegisterC(Tcl_Interp *interp, char *name, \ + Tcl_CmdProc *proc, ClientData clientData, \ + Tcl_CmdDeleteProc *deleteProc) +} +declare 3 generic { + int Itcl_RegisterObjC (Tcl_Interp *interp, char *name, \ + Tcl_ObjCmdProc *proc, ClientData clientData, \ + Tcl_CmdDeleteProc *deleteProc) +} +declare 4 generic { + int Itcl_FindC(Tcl_Interp *interp, char *name, Tcl_CmdProc **argProcPtr, \ + Tcl_ObjCmdProc **objProcPtr, ClientData *cDataPtr) +} +declare 5 generic { + void Itcl_InitStack(Itcl_Stack *stack) +} +declare 6 generic { + void Itcl_DeleteStack(Itcl_Stack *stack) +} +declare 7 generic { + void Itcl_PushStack(ClientData cdata, Itcl_Stack *stack) +} +declare 8 generic { + ClientData Itcl_PopStack(Itcl_Stack *stack) +} +declare 9 generic { + ClientData Itcl_PeekStack(Itcl_Stack *stack) +} +declare 10 generic { + ClientData Itcl_GetStackValue(Itcl_Stack *stack, int pos) +} +declare 11 generic { + void Itcl_InitList(Itcl_List *listPtr) +} +declare 12 generic { + void Itcl_DeleteList(Itcl_List *listPtr) +} +declare 13 generic { + Itcl_ListElem* Itcl_CreateListElem(Itcl_List *listPtr) +} +declare 14 generic { + Itcl_ListElem* Itcl_DeleteListElem(Itcl_ListElem *elemPtr) +} +declare 15 generic { + Itcl_ListElem* Itcl_InsertList(Itcl_List *listPtr, ClientData val) +} +declare 16 generic { + Itcl_ListElem* Itcl_InsertListElem (Itcl_ListElem *pos, ClientData val) +} +declare 17 generic { + Itcl_ListElem* Itcl_AppendList(Itcl_List *listPtr, ClientData val) +} +declare 18 generic { + Itcl_ListElem* Itcl_AppendListElem(Itcl_ListElem *pos, ClientData val) +} +declare 19 generic { + void Itcl_SetListValue(Itcl_ListElem *elemPtr, ClientData val) +} +declare 20 generic { + void Itcl_EventuallyFree(ClientData cdata, Tcl_FreeProc *fproc) +} +declare 21 generic { + void Itcl_PreserveData(ClientData cdata) +} +declare 22 generic { + void Itcl_ReleaseData(ClientData cdata) +} +declare 23 generic { + Itcl_InterpState Itcl_SaveInterpState(Tcl_Interp* interp, int status) +} +declare 24 generic { + int Itcl_RestoreInterpState(Tcl_Interp* interp, Itcl_InterpState state) +} +declare 25 generic { + void Itcl_DiscardInterpState(Itcl_InterpState state) +} diff --git a/itcl/itcl/generic/itcl.h b/itcl/itcl/generic/itcl.h index fa4c2d36e9e..4e0ad39a2d6 100644 --- a/itcl/itcl/generic/itcl.h +++ b/itcl/itcl/generic/itcl.h @@ -39,6 +39,9 @@ * mmclennan@lucent.com * http://www.tcltk.com/itcl * + * modified for Stubs 5/20/1999 by + * David Gravereaux <davygrvy@bigfoot.com> + * * RCS: $Id$ * ======================================================================== * Copyright (c) 1993-1998 Lucent Technologies, Inc. @@ -51,10 +54,21 @@ #include "tcl.h" -#define ITCL_VERSION "3.0" -#define ITCL_PATCH_LEVEL "3.0" +#undef TCL_STORAGE_CLASS +#ifdef BUILD_itcl +# define TCL_STORAGE_CLASS DLLEXPORT +#else +# ifdef USE_ITCL_STUBS +# define TCL_STORAGE_CLASS +# else +# define TCL_STORAGE_CLASS DLLIMPORT +# endif +#endif + +#define ITCL_VERSION "3.2" +#define ITCL_PATCH_LEVEL "3.2.0" #define ITCL_MAJOR_VERSION 3 -#define ITCL_MINOR_VERSION 0 +#define ITCL_MINOR_VERSION 2 #define ITCL_RELEASE_LEVEL 0 /* @@ -66,13 +80,6 @@ #ifndef RESOURCE_INCLUDED -#include "tclInt.h" - -#ifdef BUILD_itcl -# undef TCL_STORAGE_CLASS -# define TCL_STORAGE_CLASS DLLEXPORT -#endif - /* * Protection levels: * @@ -130,55 +137,32 @@ typedef struct Itcl_InterpState_ *Itcl_InterpState; /* - * Exported functions + * Include the public function declarations that are accessible via + * the stubs table. */ -EXTERN int Itcl_Init _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Itcl_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); - -EXTERN int Itcl_RegisterC _ANSI_ARGS_((Tcl_Interp *interp, - char *name, Tcl_CmdProc *proc, ClientData clientData, - Tcl_CmdDeleteProc *deleteProc)); -EXTERN int Itcl_RegisterObjC _ANSI_ARGS_((Tcl_Interp *interp, - char *name, Tcl_ObjCmdProc *proc, ClientData clientData, - Tcl_CmdDeleteProc *deleteProc)); -EXTERN int Itcl_FindC _ANSI_ARGS_((Tcl_Interp *interp, char *name, - Tcl_CmdProc **argProcPtr, Tcl_ObjCmdProc **objProcPtr, - ClientData *cDataPtr)); - -EXTERN void Itcl_InitStack _ANSI_ARGS_((Itcl_Stack *stack)); -EXTERN void Itcl_DeleteStack _ANSI_ARGS_((Itcl_Stack *stack)); -EXTERN void Itcl_PushStack _ANSI_ARGS_((ClientData cdata, - Itcl_Stack *stack)); -EXTERN ClientData Itcl_PopStack _ANSI_ARGS_((Itcl_Stack *stack)); -EXTERN ClientData Itcl_PeekStack _ANSI_ARGS_((Itcl_Stack *stack)); -EXTERN ClientData Itcl_GetStackValue _ANSI_ARGS_((Itcl_Stack *stack, - int pos)); - -EXTERN void Itcl_InitList _ANSI_ARGS_((Itcl_List *listPtr)); -EXTERN void Itcl_DeleteList _ANSI_ARGS_((Itcl_List *listPtr)); -EXTERN Itcl_ListElem* Itcl_CreateListElem _ANSI_ARGS_((Itcl_List *listPtr)); -EXTERN Itcl_ListElem* Itcl_DeleteListElem _ANSI_ARGS_((Itcl_ListElem *elemPtr)); -EXTERN Itcl_ListElem* Itcl_InsertList _ANSI_ARGS_((Itcl_List *listPtr, - ClientData val)); -EXTERN Itcl_ListElem* Itcl_InsertListElem _ANSI_ARGS_((Itcl_ListElem *pos, - ClientData val)); -EXTERN Itcl_ListElem* Itcl_AppendList _ANSI_ARGS_((Itcl_List *listPtr, - ClientData val)); -EXTERN Itcl_ListElem* Itcl_AppendListElem _ANSI_ARGS_((Itcl_ListElem *pos, - ClientData val)); -EXTERN void Itcl_SetListValue _ANSI_ARGS_((Itcl_ListElem *elemPtr, - ClientData val)); - -EXTERN void Itcl_EventuallyFree _ANSI_ARGS_((ClientData cdata, - Tcl_FreeProc *fproc)); -EXTERN void Itcl_PreserveData _ANSI_ARGS_((ClientData cdata)); -EXTERN void Itcl_ReleaseData _ANSI_ARGS_((ClientData cdata)); - -EXTERN Itcl_InterpState Itcl_SaveInterpState _ANSI_ARGS_((Tcl_Interp* interp, - int status)); -EXTERN int Itcl_RestoreInterpState _ANSI_ARGS_((Tcl_Interp* interp, - Itcl_InterpState state)); -EXTERN void Itcl_DiscardInterpState _ANSI_ARGS_((Itcl_InterpState state)); + +#include "itclDecls.h" + + +/* + * Itcl_InitStubs is used by extensions like Itk that can be linked + * against the itcl stubs library. If we are not using stubs + * then this reduces to package require. + */ + +#ifdef USE_ITCL_STUBS + +char * Itcl_InitStubs _ANSI_ARGS_((Tcl_Interp *interp, + char *version, int exact)); +#else +#define Itcl_InitStubs(interp, version, exact) \ + Tcl_PkgRequire(interp, "Itcl", version, exact) +#endif + +/* + * Public functions that are not accessible via the stubs table. + */ + #endif /* RESOURCE_INCLUDED */ diff --git a/itcl/itcl/generic/itclDecls.h b/itcl/itcl/generic/itclDecls.h new file mode 100644 index 00000000000..aeb220d1c48 --- /dev/null +++ b/itcl/itcl/generic/itclDecls.h @@ -0,0 +1,263 @@ +/* + * itclDecls.h -- + * + * Declarations of functions in the platform independent public Itcl API. + * + * Copyright (c) 1998-1999 by XXXX + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: $Id$ + */ + +#ifndef _ITCLDECLS +#define _ITCLDECLS + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the itcl/generic/tcl.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +/* + * Exported function declarations: + */ + +/* 0 */ +EXTERN int Itcl_Init _ANSI_ARGS_((Tcl_Interp * interp)); +/* 1 */ +EXTERN int Itcl_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); +/* 2 */ +EXTERN int Itcl_RegisterC _ANSI_ARGS_((Tcl_Interp * interp, + char * name, Tcl_CmdProc * proc, + ClientData clientData, + Tcl_CmdDeleteProc * deleteProc)); +/* 3 */ +EXTERN int Itcl_RegisterObjC _ANSI_ARGS_((Tcl_Interp * interp, + char * name, Tcl_ObjCmdProc * proc, + ClientData clientData, + Tcl_CmdDeleteProc * deleteProc)); +/* 4 */ +EXTERN int Itcl_FindC _ANSI_ARGS_((Tcl_Interp * interp, + char * name, Tcl_CmdProc ** argProcPtr, + Tcl_ObjCmdProc ** objProcPtr, + ClientData * cDataPtr)); +/* 5 */ +EXTERN void Itcl_InitStack _ANSI_ARGS_((Itcl_Stack * stack)); +/* 6 */ +EXTERN void Itcl_DeleteStack _ANSI_ARGS_((Itcl_Stack * stack)); +/* 7 */ +EXTERN void Itcl_PushStack _ANSI_ARGS_((ClientData cdata, + Itcl_Stack * stack)); +/* 8 */ +EXTERN ClientData Itcl_PopStack _ANSI_ARGS_((Itcl_Stack * stack)); +/* 9 */ +EXTERN ClientData Itcl_PeekStack _ANSI_ARGS_((Itcl_Stack * stack)); +/* 10 */ +EXTERN ClientData Itcl_GetStackValue _ANSI_ARGS_((Itcl_Stack * stack, + int pos)); +/* 11 */ +EXTERN void Itcl_InitList _ANSI_ARGS_((Itcl_List * listPtr)); +/* 12 */ +EXTERN void Itcl_DeleteList _ANSI_ARGS_((Itcl_List * listPtr)); +/* 13 */ +EXTERN Itcl_ListElem* Itcl_CreateListElem _ANSI_ARGS_((Itcl_List * listPtr)); +/* 14 */ +EXTERN Itcl_ListElem* Itcl_DeleteListElem _ANSI_ARGS_(( + Itcl_ListElem * elemPtr)); +/* 15 */ +EXTERN Itcl_ListElem* Itcl_InsertList _ANSI_ARGS_((Itcl_List * listPtr, + ClientData val)); +/* 16 */ +EXTERN Itcl_ListElem* Itcl_InsertListElem _ANSI_ARGS_((Itcl_ListElem * pos, + ClientData val)); +/* 17 */ +EXTERN Itcl_ListElem* Itcl_AppendList _ANSI_ARGS_((Itcl_List * listPtr, + ClientData val)); +/* 18 */ +EXTERN Itcl_ListElem* Itcl_AppendListElem _ANSI_ARGS_((Itcl_ListElem * pos, + ClientData val)); +/* 19 */ +EXTERN void Itcl_SetListValue _ANSI_ARGS_(( + Itcl_ListElem * elemPtr, ClientData val)); +/* 20 */ +EXTERN void Itcl_EventuallyFree _ANSI_ARGS_((ClientData cdata, + Tcl_FreeProc * fproc)); +/* 21 */ +EXTERN void Itcl_PreserveData _ANSI_ARGS_((ClientData cdata)); +/* 22 */ +EXTERN void Itcl_ReleaseData _ANSI_ARGS_((ClientData cdata)); +/* 23 */ +EXTERN Itcl_InterpState Itcl_SaveInterpState _ANSI_ARGS_(( + Tcl_Interp* interp, int status)); +/* 24 */ +EXTERN int Itcl_RestoreInterpState _ANSI_ARGS_(( + Tcl_Interp* interp, Itcl_InterpState state)); +/* 25 */ +EXTERN void Itcl_DiscardInterpState _ANSI_ARGS_(( + Itcl_InterpState state)); + +typedef struct ItclStubHooks { + struct ItclIntStubs *itclIntStubs; +} ItclStubHooks; + +typedef struct ItclStubs { + int magic; + struct ItclStubHooks *hooks; + + int (*itcl_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */ + int (*itcl_SafeInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 1 */ + int (*itcl_RegisterC) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_CmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 2 */ + int (*itcl_RegisterObjC) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_ObjCmdProc * proc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 3 */ + int (*itcl_FindC) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_CmdProc ** argProcPtr, Tcl_ObjCmdProc ** objProcPtr, ClientData * cDataPtr)); /* 4 */ + void (*itcl_InitStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 5 */ + void (*itcl_DeleteStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 6 */ + void (*itcl_PushStack) _ANSI_ARGS_((ClientData cdata, Itcl_Stack * stack)); /* 7 */ + ClientData (*itcl_PopStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 8 */ + ClientData (*itcl_PeekStack) _ANSI_ARGS_((Itcl_Stack * stack)); /* 9 */ + ClientData (*itcl_GetStackValue) _ANSI_ARGS_((Itcl_Stack * stack, int pos)); /* 10 */ + void (*itcl_InitList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 11 */ + void (*itcl_DeleteList) _ANSI_ARGS_((Itcl_List * listPtr)); /* 12 */ + Itcl_ListElem* (*itcl_CreateListElem) _ANSI_ARGS_((Itcl_List * listPtr)); /* 13 */ + Itcl_ListElem* (*itcl_DeleteListElem) _ANSI_ARGS_((Itcl_ListElem * elemPtr)); /* 14 */ + Itcl_ListElem* (*itcl_InsertList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 15 */ + Itcl_ListElem* (*itcl_InsertListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 16 */ + Itcl_ListElem* (*itcl_AppendList) _ANSI_ARGS_((Itcl_List * listPtr, ClientData val)); /* 17 */ + Itcl_ListElem* (*itcl_AppendListElem) _ANSI_ARGS_((Itcl_ListElem * pos, ClientData val)); /* 18 */ + void (*itcl_SetListValue) _ANSI_ARGS_((Itcl_ListElem * elemPtr, ClientData val)); /* 19 */ + void (*itcl_EventuallyFree) _ANSI_ARGS_((ClientData cdata, Tcl_FreeProc * fproc)); /* 20 */ + void (*itcl_PreserveData) _ANSI_ARGS_((ClientData cdata)); /* 21 */ + void (*itcl_ReleaseData) _ANSI_ARGS_((ClientData cdata)); /* 22 */ + Itcl_InterpState (*itcl_SaveInterpState) _ANSI_ARGS_((Tcl_Interp* interp, int status)); /* 23 */ + int (*itcl_RestoreInterpState) _ANSI_ARGS_((Tcl_Interp* interp, Itcl_InterpState state)); /* 24 */ + void (*itcl_DiscardInterpState) _ANSI_ARGS_((Itcl_InterpState state)); /* 25 */ +} ItclStubs; + +#ifdef __cplusplus +extern "C" { +#endif +extern ItclStubs *itclStubsPtr; +#ifdef __cplusplus +} +#endif + +#if defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) + +/* + * Inline function declarations: + */ + +#ifndef Itcl_Init +#define Itcl_Init \ + (itclStubsPtr->itcl_Init) /* 0 */ +#endif +#ifndef Itcl_SafeInit +#define Itcl_SafeInit \ + (itclStubsPtr->itcl_SafeInit) /* 1 */ +#endif +#ifndef Itcl_RegisterC +#define Itcl_RegisterC \ + (itclStubsPtr->itcl_RegisterC) /* 2 */ +#endif +#ifndef Itcl_RegisterObjC +#define Itcl_RegisterObjC \ + (itclStubsPtr->itcl_RegisterObjC) /* 3 */ +#endif +#ifndef Itcl_FindC +#define Itcl_FindC \ + (itclStubsPtr->itcl_FindC) /* 4 */ +#endif +#ifndef Itcl_InitStack +#define Itcl_InitStack \ + (itclStubsPtr->itcl_InitStack) /* 5 */ +#endif +#ifndef Itcl_DeleteStack +#define Itcl_DeleteStack \ + (itclStubsPtr->itcl_DeleteStack) /* 6 */ +#endif +#ifndef Itcl_PushStack +#define Itcl_PushStack \ + (itclStubsPtr->itcl_PushStack) /* 7 */ +#endif +#ifndef Itcl_PopStack +#define Itcl_PopStack \ + (itclStubsPtr->itcl_PopStack) /* 8 */ +#endif +#ifndef Itcl_PeekStack +#define Itcl_PeekStack \ + (itclStubsPtr->itcl_PeekStack) /* 9 */ +#endif +#ifndef Itcl_GetStackValue +#define Itcl_GetStackValue \ + (itclStubsPtr->itcl_GetStackValue) /* 10 */ +#endif +#ifndef Itcl_InitList +#define Itcl_InitList \ + (itclStubsPtr->itcl_InitList) /* 11 */ +#endif +#ifndef Itcl_DeleteList +#define Itcl_DeleteList \ + (itclStubsPtr->itcl_DeleteList) /* 12 */ +#endif +#ifndef Itcl_CreateListElem +#define Itcl_CreateListElem \ + (itclStubsPtr->itcl_CreateListElem) /* 13 */ +#endif +#ifndef Itcl_DeleteListElem +#define Itcl_DeleteListElem \ + (itclStubsPtr->itcl_DeleteListElem) /* 14 */ +#endif +#ifndef Itcl_InsertList +#define Itcl_InsertList \ + (itclStubsPtr->itcl_InsertList) /* 15 */ +#endif +#ifndef Itcl_InsertListElem +#define Itcl_InsertListElem \ + (itclStubsPtr->itcl_InsertListElem) /* 16 */ +#endif +#ifndef Itcl_AppendList +#define Itcl_AppendList \ + (itclStubsPtr->itcl_AppendList) /* 17 */ +#endif +#ifndef Itcl_AppendListElem +#define Itcl_AppendListElem \ + (itclStubsPtr->itcl_AppendListElem) /* 18 */ +#endif +#ifndef Itcl_SetListValue +#define Itcl_SetListValue \ + (itclStubsPtr->itcl_SetListValue) /* 19 */ +#endif +#ifndef Itcl_EventuallyFree +#define Itcl_EventuallyFree \ + (itclStubsPtr->itcl_EventuallyFree) /* 20 */ +#endif +#ifndef Itcl_PreserveData +#define Itcl_PreserveData \ + (itclStubsPtr->itcl_PreserveData) /* 21 */ +#endif +#ifndef Itcl_ReleaseData +#define Itcl_ReleaseData \ + (itclStubsPtr->itcl_ReleaseData) /* 22 */ +#endif +#ifndef Itcl_SaveInterpState +#define Itcl_SaveInterpState \ + (itclStubsPtr->itcl_SaveInterpState) /* 23 */ +#endif +#ifndef Itcl_RestoreInterpState +#define Itcl_RestoreInterpState \ + (itclStubsPtr->itcl_RestoreInterpState) /* 24 */ +#endif +#ifndef Itcl_DiscardInterpState +#define Itcl_DiscardInterpState \ + (itclStubsPtr->itcl_DiscardInterpState) /* 25 */ +#endif + +#endif /* defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) */ + +/* !END!: Do not edit above this line. */ + +#endif /* _ITCLDECLS */ + diff --git a/itcl/itcl/generic/itclInt.decls b/itcl/itcl/generic/itclInt.decls new file mode 100644 index 00000000000..50d16764783 --- /dev/null +++ b/itcl/itcl/generic/itclInt.decls @@ -0,0 +1,500 @@ +# itclInt.decls -- +# +# This file contains the declarations for all unsupported +# functions that are exported by the Tcl library. This file +# is used to generate the itclIntDecls.h and itclIntStub.c +# files +# +# Copyright (c) 1998-1999 by Scriptics Corporation. +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# RCS: @(#) $Id$ + +library itcl + +# Define the unsupported generic interfaces. + +interface itclInt + + +# +# Functions used within the package, but not considered "public" +# + +declare 0 generic { + int Itcl_IsClassNamespace(Tcl_Namespace *namesp) +} +declare 1 generic { + int Itcl_IsClass (Tcl_Command cmd) +} +declare 2 generic { + ItclClass* Itcl_FindClass (Tcl_Interp* interp, char* path, int autoload) +} +declare 3 generic { + int Itcl_FindObject (Tcl_Interp *interp, char *name, ItclObject **roPtr) +} +declare 4 generic { + int Itcl_IsObject (Tcl_Command cmd) +} +declare 5 generic { + int Itcl_ObjectIsa (ItclObject *contextObj, ItclClass *cdefn) +} +declare 6 generic { + int Itcl_Protection (Tcl_Interp *interp, int newLevel) +} +declare 7 generic { + char* Itcl_ProtectionStr (int pLevel) +} +declare 8 generic { + int Itcl_CanAccess (ItclMember* memberPtr, Tcl_Namespace* fromNsPtr) +} +declare 9 generic { + int Itcl_CanAccessFunc (ItclMemberFunc* mfunc, Tcl_Namespace* fromNsPtr) +} +declare 10 generic { + Tcl_Namespace* Itcl_GetTrueNamespace (Tcl_Interp *interp, \ + ItclObjectInfo *info) +} +declare 11 generic { + void Itcl_ParseNamespPath (char *name, Tcl_DString *buffer, \ + char **head, char **tail) +} +declare 12 generic { + int Itcl_DecodeScopedCommand (Tcl_Interp *interp, char *name, \ + Tcl_Namespace **rNsPtr, char **rCmdPtr) +} +declare 13 generic { + int Itcl_EvalArgs (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) +} +declare 14 generic { + Tcl_Obj* Itcl_CreateArgs (Tcl_Interp *interp, char *string, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 15 generic { + int Itcl_PushContext (Tcl_Interp *interp, ItclMember *member, \ + ItclClass *contextClass, ItclObject *contextObj, \ + ItclContext *contextPtr) +} +declare 16 generic { + void Itcl_PopContext (Tcl_Interp *interp, ItclContext *contextPtr) +} +declare 17 generic { + int Itcl_GetContext (Tcl_Interp *interp, ItclClass **cdefnPtr, \ + ItclObject **odefnPtr) +} +declare 18 generic { + void Itcl_InitHierIter (ItclHierIter *iter, ItclClass *cdefn) +} +declare 19 generic { + void Itcl_DeleteHierIter (ItclHierIter *iter) +} +declare 20 generic { + ItclClass* Itcl_AdvanceHierIter (ItclHierIter *iter) +} +declare 21 generic { + int Itcl_FindClassesCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 22 generic { + int Itcl_FindObjectsCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 23 generic { + int Itcl_ProtectionCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 24 generic { + int Itcl_DelClassCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 25 generic { + int Itcl_DelObjectCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 26 generic { + int Itcl_ScopeCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 27 generic { + int Itcl_CodeCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 28 generic { + int Itcl_StubCreateCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 29 generic { + int Itcl_StubExistsCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 30 generic { + int Itcl_IsStub (Tcl_Command cmd) +} + + +# +# Functions for manipulating classes +# + +declare 31 generic { + int Itcl_CreateClass (Tcl_Interp* interp, char* path, \ + ItclObjectInfo *info, ItclClass **rPtr) +} +declare 32 generic { + int Itcl_DeleteClass (Tcl_Interp *interp, ItclClass *cdefnPtr) +} +declare 33 generic { + Tcl_Namespace* Itcl_FindClassNamespace (Tcl_Interp* interp, char* path) +} +declare 34 generic { + int Itcl_HandleClass (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 35 generic { + int Itcl_ClassCmdResolver (Tcl_Interp *interp, char* name, \ + Tcl_Namespace *context, int flags, Tcl_Command *rPtr) +} +declare 36 generic { + int Itcl_ClassVarResolver (Tcl_Interp *interp, char* name, \ + Tcl_Namespace *context, int flags, Tcl_Var *rPtr) +} +declare 37 generic { + int Itcl_ClassCompiledVarResolver (Tcl_Interp *interp, char* name, \ + int length, Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr) +} +declare 38 generic { + void Itcl_BuildVirtualTables (ItclClass* cdefnPtr) +} +declare 39 generic { + int Itcl_CreateVarDefn (Tcl_Interp *interp, ItclClass* cdefn, \ + char* name, char* init, char* config, ItclVarDefn** vdefnPtr) +} +declare 40 generic { + void Itcl_DeleteVarDefn (ItclVarDefn *vdefn) +} +declare 41 generic { + char* Itcl_GetCommonVar (Tcl_Interp *interp, char *name, \ + ItclClass *contextClass) +} +declare 42 generic { + ItclMember* Itcl_CreateMember (Tcl_Interp* interp, ItclClass *cdefn, \ + char* name) +} +declare 43 generic { + void Itcl_DeleteMember (ItclMember *memPtr) +} + + +# +# Functions for manipulating objects +# + +declare 44 generic { + int Itcl_CreateObject (Tcl_Interp *interp, char* name, ItclClass *cdefn, \ + int objc, Tcl_Obj *CONST objv[], ItclObject **roPtr) +} +declare 45 generic { + int Itcl_DeleteObject (Tcl_Interp *interp, ItclObject *contextObj) +} +declare 46 generic { + int Itcl_DestructObject (Tcl_Interp *interp, ItclObject *contextObj, \ + int flags) +} +declare 47 generic { + int Itcl_HandleInstance (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 48 generic { + char* Itcl_GetInstanceVar (Tcl_Interp *interp, char *name, \ + ItclObject *contextObj, ItclClass *contextClass) +} +declare 49 generic { + int Itcl_ScopedVarResolver (Tcl_Interp *interp, char *name, \ + Tcl_Namespace *contextNs, int flags, Tcl_Var *rPtr) +} + + +# +# Functions for manipulating methods and procs +# + +declare 50 generic { + int Itcl_BodyCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 51 generic { + int Itcl_ConfigBodyCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 52 generic { + int Itcl_CreateMethod (Tcl_Interp* interp, ItclClass *cdefn, char* name, \ + char* arglist, char* body) +} +declare 53 generic { + int Itcl_CreateProc (Tcl_Interp* interp, ItclClass *cdefn, char* name, \ + char* arglist, char* body) +} +declare 54 generic { + int Itcl_CreateMemberFunc (Tcl_Interp* interp, ItclClass *cdefn, \ + char* name, char* arglist, char* body, ItclMemberFunc** mfuncPtr) +} +declare 55 generic { + int Itcl_ChangeMemberFunc (Tcl_Interp* interp, ItclMemberFunc* mfunc, \ + char* arglist, char* body) +} +declare 56 generic { + void Itcl_DeleteMemberFunc (char* cdata) +} +declare 57 generic { + int Itcl_CreateMemberCode (Tcl_Interp* interp, ItclClass *cdefn, \ + char* arglist, char* body, ItclMemberCode** mcodePtr) +} +declare 58 generic { + void Itcl_DeleteMemberCode (char* cdata) +} +declare 59 generic { + int Itcl_GetMemberCode (Tcl_Interp* interp, ItclMember* member) +} +#declare 60 generic { +# int Itcl_CompileMemberCodeBody (Tcl_Interp *interp, ItclMember *member, \ +# char *desc, Tcl_Obj *bodyPtr) +#} +declare 61 generic { + int Itcl_EvalMemberCode (Tcl_Interp *interp, ItclMemberFunc *mfunc, \ + ItclMember *member, ItclObject *contextObj, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 62 generic { + int Itcl_CreateArgList (Tcl_Interp* interp, char* decl, int* argcPtr, \ + CompiledLocal** argPtr) +} +declare 63 generic { + CompiledLocal* Itcl_CreateArg (char* name, char* init) +} +declare 64 generic { + void Itcl_DeleteArgList (CompiledLocal *arglist) +} +declare 65 generic { + Tcl_Obj* Itcl_ArgList (int argc, CompiledLocal* arglist) +} +declare 66 generic { + int Itcl_EquivArgLists (CompiledLocal* arg1, int arg1c, \ + CompiledLocal* arg2, int arg2c) +} +declare 67 generic { + void Itcl_GetMemberFuncUsage (ItclMemberFunc *mfunc, \ + ItclObject *contextObj, Tcl_Obj *objPtr) +} +declare 68 generic { + int Itcl_ExecMethod (ClientData clientData, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 69 generic { + int Itcl_ExecProc (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 70 generic { + int Itcl_AssignArgs (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], \ + ItclMemberFunc *mfunc) +} +declare 71 generic { + int Itcl_ConstructBase (Tcl_Interp *interp, ItclObject *contextObj, \ + ItclClass *contextClass) +} +declare 72 generic { + int Itcl_InvokeMethodIfExists (Tcl_Interp *interp, char *name, \ + ItclClass *contextClass, ItclObject *contextObj, int objc, \ + Tcl_Obj *CONST objv[]) +} +#declare 73 generic { +# int Itcl_EvalBody (Tcl_Interp *interp, Tcl_Obj *bodyPtr) +#} +declare 74 generic { + int Itcl_ReportFuncErrors (Tcl_Interp* interp, ItclMemberFunc *mfunc, \ + ItclObject *contextObj, int result) +} + + +# +# Commands for parsing class definitions +# + +declare 75 generic { + int Itcl_ParseInit (Tcl_Interp *interp, ItclObjectInfo *info) +} +declare 76 generic { + int Itcl_ClassCmd (ClientData clientData, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 77 generic { + int Itcl_ClassInheritCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 78 generic { + int Itcl_ClassProtectionCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 79 generic { + int Itcl_ClassConstructorCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 80 generic { + int Itcl_ClassDestructorCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 81 generic { + int Itcl_ClassMethodCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 82 generic { + int Itcl_ClassProcCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 83 generic { + int Itcl_ClassVariableCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 84 generic { + int Itcl_ClassCommonCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 85 generic { + int Itcl_ParseVarResolver (Tcl_Interp *interp, char* name, \ + Tcl_Namespace *contextNs, int flags, Tcl_Var* rPtr) +} + + +# +# Commands in the "builtin" namespace +# + +declare 86 generic { + int Itcl_BiInit (Tcl_Interp *interp) +} +declare 87 generic { + int Itcl_InstallBiMethods (Tcl_Interp *interp, ItclClass *cdefn) +} +declare 88 generic { + int Itcl_BiIsaCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 89 generic { + int Itcl_BiConfigureCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 90 generic { + int Itcl_BiCgetCmd (ClientData clientData, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 91 generic { + int Itcl_BiChainCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 92 generic { + int Itcl_BiInfoClassCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 93 generic { + int Itcl_BiInfoInheritCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 94 generic { + int Itcl_BiInfoHeritageCmd (ClientData dummy, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 95 generic { + int Itcl_BiInfoFunctionCmd (ClientData dummy, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 96 generic { + int Itcl_BiInfoVariableCmd (ClientData dummy, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} +declare 97 generic { + int Itcl_BiInfoBodyCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 98 generic { + int Itcl_BiInfoArgsCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 99 generic { + int Itcl_DefaultInfoCmd (ClientData dummy, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} + + +# +# Ensembles +# + +declare 100 generic { + int Itcl_EnsembleInit (Tcl_Interp *interp) +} +declare 101 generic { + int Itcl_CreateEnsemble (Tcl_Interp *interp, char* ensName) +} +declare 102 generic { + int Itcl_AddEnsemblePart (Tcl_Interp *interp, char* ensName, \ + char* partName, char* usageInfo, Tcl_ObjCmdProc *objProc, \ + ClientData clientData, Tcl_CmdDeleteProc *deleteProc) +} +declare 103 generic { + int Itcl_GetEnsemblePart (Tcl_Interp *interp, char *ensName, \ + char *partName, Tcl_CmdInfo *infoPtr) +} +declare 104 generic { + int Itcl_IsEnsemble (Tcl_CmdInfo* infoPtr) +} +declare 105 generic { + int Itcl_GetEnsembleUsage (Tcl_Interp *interp, char *ensName, \ + Tcl_Obj *objPtr) +} +declare 106 generic { + int Itcl_GetEnsembleUsageForObj (Tcl_Interp *interp, Tcl_Obj *ensObjPtr, \ + Tcl_Obj *objPtr) +} +declare 107 generic { + int Itcl_EnsembleCmd (ClientData clientData, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 108 generic { + int Itcl_EnsPartCmd (ClientData clientData, Tcl_Interp *interp, int objc, \ + Tcl_Obj *CONST objv[]) +} +declare 109 generic { + int Itcl_EnsembleErrorCmd (ClientData clientData, Tcl_Interp *interp, \ + int objc, Tcl_Obj *CONST objv[]) +} + + +# +# Commands provided for backward compatibility +# + +declare 110 generic { + int Itcl_OldInit (Tcl_Interp* interp, ItclObjectInfo* info) +} +declare 111 generic { + int Itcl_InstallOldBiMethods (Tcl_Interp *interp, ItclClass *cdefn) +} + + +# +# Things that should be in the Tcl core. +# + +declare 112 generic { + Tcl_CallFrame* _Tcl_GetCallFrame (Tcl_Interp *interp, int level) +} +declare 113 generic { + Tcl_CallFrame* _Tcl_ActivateCallFrame (Tcl_Interp *interp, \ + Tcl_CallFrame *framePtr) +} +declare 114 generic { + Var* _TclNewVar (void) +} +declare 115 generic { + void Itcl_Assert (char *testExpr, char *fileName, int lineNum) +} diff --git a/itcl/itcl/generic/itclInt.h b/itcl/itcl/generic/itclInt.h index 9ca1323dab0..a3bb712729e 100644 --- a/itcl/itcl/generic/itclInt.h +++ b/itcl/itcl/generic/itclInt.h @@ -57,24 +57,6 @@ # define TCL_STORAGE_CLASS DLLEXPORT #endif -/* - * Since the Tcl/Tk distribution doesn't perform any asserts, - * dynamic loading can fail to find the __assert function. - * As a workaround, we'll include our own. - */ -#undef assert -#ifdef NDEBUG -#define assert(EX) ((void)0) -#else -EXTERN void Itcl_Assert _ANSI_ARGS_((char *testExpr, char *fileName, int lineNum) -); -#if defined(__STDC__) -#define assert(EX) (void)((EX) || (Itcl_Assert(#EX, __FILE__, __LINE__), 0)) -#else -#define assert(EX) (void)((EX) || (Itcl_Assert("EX", __FILE__, __LINE__), 0)) -#endif /* __STDC__ */ -#endif /* NDEBUG */ - /* * Common info for managing all known objects. @@ -257,277 +239,24 @@ typedef struct ItclContext { } ItclContext; -/* - * Functions used within the package, but not considered "public" - */ - -EXTERN int Itcl_IsClassNamespace _ANSI_ARGS_((Tcl_Namespace *namesp)); -EXTERN int Itcl_IsClass _ANSI_ARGS_((Tcl_Command cmd)); -EXTERN ItclClass* Itcl_FindClass _ANSI_ARGS_((Tcl_Interp* interp, - char* path, int autoload)); - -EXTERN int Itcl_FindObject _ANSI_ARGS_((Tcl_Interp *interp, - char *name, ItclObject **roPtr)); -EXTERN int Itcl_IsObject _ANSI_ARGS_((Tcl_Command cmd)); -EXTERN int Itcl_ObjectIsa _ANSI_ARGS_((ItclObject *contextObj, - ItclClass *cdefn)); - - -EXTERN int Itcl_Protection _ANSI_ARGS_((Tcl_Interp *interp, - int newLevel)); -EXTERN char* Itcl_ProtectionStr _ANSI_ARGS_((int pLevel)); -EXTERN int Itcl_CanAccess _ANSI_ARGS_((ItclMember* memberPtr, - Tcl_Namespace* fromNsPtr)); -EXTERN int Itcl_CanAccessFunc _ANSI_ARGS_((ItclMemberFunc* mfunc, - Tcl_Namespace* fromNsPtr)); -EXTERN Tcl_Namespace* Itcl_GetTrueNamespace _ANSI_ARGS_((Tcl_Interp *interp, - ItclObjectInfo *info)); - -EXTERN void Itcl_ParseNamespPath _ANSI_ARGS_((char *name, - Tcl_DString *buffer, char **head, char **tail)); -EXTERN int Itcl_DecodeScopedCommand _ANSI_ARGS_((Tcl_Interp *interp, - char *name, Tcl_Namespace **rNsPtr, char **rCmdPtr)); -EXTERN int Itcl_EvalArgs _ANSI_ARGS_((Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[])); -EXTERN Tcl_Obj* Itcl_CreateArgs _ANSI_ARGS_((Tcl_Interp *interp, - char *string, int objc, Tcl_Obj *CONST objv[])); - -EXTERN int Itcl_PushContext _ANSI_ARGS_((Tcl_Interp *interp, - ItclMember *member, ItclClass *contextClass, ItclObject *contextObj, - ItclContext *contextPtr)); -EXTERN void Itcl_PopContext _ANSI_ARGS_((Tcl_Interp *interp, - ItclContext *contextPtr)); -EXTERN int Itcl_GetContext _ANSI_ARGS_((Tcl_Interp *interp, - ItclClass **cdefnPtr, ItclObject **odefnPtr)); - -EXTERN void Itcl_InitHierIter _ANSI_ARGS_((ItclHierIter *iter, - ItclClass *cdefn)); -EXTERN void Itcl_DeleteHierIter _ANSI_ARGS_((ItclHierIter *iter)); -EXTERN ItclClass* Itcl_AdvanceHierIter _ANSI_ARGS_((ItclHierIter *iter)); - -EXTERN int Itcl_FindClassesCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_FindObjectsCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ProtectionCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_DelClassCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_DelObjectCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ScopeCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_CodeCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_StubCreateCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_StubExistsCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_IsStub _ANSI_ARGS_((Tcl_Command cmd)); - - -/* - * Functions for manipulating classes - */ -EXTERN int Itcl_CreateClass _ANSI_ARGS_((Tcl_Interp* interp, char* path, - ItclObjectInfo *info, ItclClass **rPtr)); -EXTERN int Itcl_DeleteClass _ANSI_ARGS_((Tcl_Interp *interp, - ItclClass *cdefnPtr)); -EXTERN Tcl_Namespace* Itcl_FindClassNamespace _ANSI_ARGS_((Tcl_Interp* interp, - char* path)); -EXTERN int Itcl_HandleClass _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassCmdResolver _ANSI_ARGS_((Tcl_Interp *interp, - char* name, Tcl_Namespace *context, int flags, Tcl_Command *rPtr)); -EXTERN int Itcl_ClassVarResolver _ANSI_ARGS_((Tcl_Interp *interp, - char* name, Tcl_Namespace *context, int flags, Tcl_Var *rPtr)); -EXTERN int Itcl_ClassCompiledVarResolver _ANSI_ARGS_((Tcl_Interp *interp, - char* name, int length, Tcl_Namespace *context, Tcl_ResolvedVarInfo **rPtr)); -EXTERN void Itcl_BuildVirtualTables _ANSI_ARGS_((ItclClass* cdefnPtr)); -EXTERN int Itcl_CreateVarDefn _ANSI_ARGS_((Tcl_Interp *interp, - ItclClass* cdefn, char* name, char* init, char* config, - ItclVarDefn** vdefnPtr)); -EXTERN void Itcl_DeleteVarDefn _ANSI_ARGS_((ItclVarDefn *vdefn)); -EXTERN char* Itcl_GetCommonVar _ANSI_ARGS_((Tcl_Interp *interp, - char *name, ItclClass *contextClass)); -EXTERN ItclMember* Itcl_CreateMember _ANSI_ARGS_((Tcl_Interp* interp, - ItclClass *cdefn, char* name)); -EXTERN void Itcl_DeleteMember _ANSI_ARGS_((ItclMember *memPtr)); - +#include "itclIntDecls.h" /* - * Functions for manipulating objects - */ -EXTERN int Itcl_CreateObject _ANSI_ARGS_((Tcl_Interp *interp, - char* name, ItclClass *cdefn, int objc, Tcl_Obj *CONST objv[], - ItclObject **roPtr)); -EXTERN int Itcl_DeleteObject _ANSI_ARGS_((Tcl_Interp *interp, - ItclObject *contextObj)); -EXTERN int Itcl_DestructObject _ANSI_ARGS_((Tcl_Interp *interp, - ItclObject *contextObj, int flags)); -EXTERN int Itcl_HandleInstance _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN char* Itcl_GetInstanceVar _ANSI_ARGS_((Tcl_Interp *interp, - char *name, ItclObject *contextObj, ItclClass *contextClass)); -EXTERN int Itcl_ScopedVarResolver _ANSI_ARGS_((Tcl_Interp *interp, - char *name, Tcl_Namespace *contextNs, int flags, Tcl_Var *rPtr)); - - -/* - * Functions for manipulating methods and procs - */ -EXTERN int Itcl_BodyCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ConfigBodyCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_CreateMethod _ANSI_ARGS_((Tcl_Interp* interp, - ItclClass *cdefn, char* name, char* arglist, char* body)); -EXTERN int Itcl_CreateProc _ANSI_ARGS_((Tcl_Interp* interp, - ItclClass *cdefn, char* name, char* arglist, char* body)); -EXTERN int Itcl_CreateMemberFunc _ANSI_ARGS_((Tcl_Interp* interp, - ItclClass *cdefn, char* name, char* arglist, char* body, - ItclMemberFunc** mfuncPtr)); -EXTERN int Itcl_ChangeMemberFunc _ANSI_ARGS_((Tcl_Interp* interp, - ItclMemberFunc* mfunc, char* arglist, char* body)); -EXTERN void Itcl_DeleteMemberFunc _ANSI_ARGS_((char* cdata)); -EXTERN int Itcl_CreateMemberCode _ANSI_ARGS_((Tcl_Interp* interp, - ItclClass *cdefn, char* arglist, char* body, ItclMemberCode** mcodePtr)); -EXTERN void Itcl_DeleteMemberCode _ANSI_ARGS_((char* cdata)); -EXTERN int Itcl_GetMemberCode _ANSI_ARGS_((Tcl_Interp* interp, - ItclMember* member)); -EXTERN int Itcl_CompileMemberCodeBody _ANSI_ARGS_((Tcl_Interp *interp, - ItclMember *member, char *desc, Tcl_Obj *bodyPtr)); -EXTERN int Itcl_EvalMemberCode _ANSI_ARGS_((Tcl_Interp *interp, - ItclMemberFunc *mfunc, ItclMember *member, ItclObject *contextObj, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_CreateArgList _ANSI_ARGS_((Tcl_Interp* interp, - char* decl, int* argcPtr, CompiledLocal** argPtr)); -EXTERN CompiledLocal* Itcl_CreateArg _ANSI_ARGS_((char* name, - char* init)); -EXTERN void Itcl_DeleteArgList _ANSI_ARGS_((CompiledLocal *arglist)); -EXTERN Tcl_Obj* Itcl_ArgList _ANSI_ARGS_((int argc, CompiledLocal* arglist)); -EXTERN int Itcl_EquivArgLists _ANSI_ARGS_((CompiledLocal* arg1, int arg1c, - CompiledLocal* arg2, int arg2c)); -EXTERN void Itcl_GetMemberFuncUsage _ANSI_ARGS_((ItclMemberFunc *mfunc, - ItclObject *contextObj, Tcl_Obj *objPtr)); -EXTERN int Itcl_ExecMethod _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ExecProc _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_AssignArgs _ANSI_ARGS_((Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[], ItclMemberFunc *mfunc)); -EXTERN int Itcl_ConstructBase _ANSI_ARGS_((Tcl_Interp *interp, - ItclObject *contextObj, ItclClass *contextClass)); -EXTERN int Itcl_InvokeMethodIfExists _ANSI_ARGS_((Tcl_Interp *interp, - char *name, ItclClass *contextClass, ItclObject *contextObj, - int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_EvalBody _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *bodyPtr)); -EXTERN int Itcl_ReportFuncErrors _ANSI_ARGS_((Tcl_Interp* interp, - ItclMemberFunc *mfunc, ItclObject *contextObj, int result)); - - -/* - * Commands for parsing class definitions - */ -EXTERN int Itcl_ParseInit _ANSI_ARGS_((Tcl_Interp *interp, - ItclObjectInfo *info)); -EXTERN int Itcl_ClassCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassInheritCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassProtectionCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassConstructorCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassDestructorCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassMethodCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassProcCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassVariableCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ClassCommonCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_ParseVarResolver _ANSI_ARGS_((Tcl_Interp *interp, - char* name, Tcl_Namespace *contextNs, int flags, Tcl_Var* rPtr)); - - -/* - * Commands in the "builtin" namespace - */ -EXTERN int Itcl_BiInit _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Itcl_InstallBiMethods _ANSI_ARGS_((Tcl_Interp *interp, - ItclClass *cdefn)); -EXTERN int Itcl_BiIsaCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiConfigureCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiCgetCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiChainCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoClassCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoInheritCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoHeritageCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoFunctionCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoVariableCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoBodyCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_BiInfoArgsCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_DefaultInfoCmd _ANSI_ARGS_((ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); - - -/* - * Ensembles - */ -EXTERN int Itcl_EnsembleInit _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Itcl_CreateEnsemble _ANSI_ARGS_((Tcl_Interp *interp, - char* ensName)); -EXTERN int Itcl_AddEnsemblePart _ANSI_ARGS_((Tcl_Interp *interp, - char* ensName, char* partName, char* usageInfo, - Tcl_ObjCmdProc *objProc, ClientData clientData, - Tcl_CmdDeleteProc *deleteProc)); -EXTERN int Itcl_GetEnsemblePart _ANSI_ARGS_((Tcl_Interp *interp, - char *ensName, char *partName, Tcl_CmdInfo *infoPtr)); -EXTERN int Itcl_IsEnsemble _ANSI_ARGS_((Tcl_CmdInfo* infoPtr)); -EXTERN int Itcl_GetEnsembleUsage _ANSI_ARGS_((Tcl_Interp *interp, - char *ensName, Tcl_Obj *objPtr)); -EXTERN int Itcl_GetEnsembleUsageForObj _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_Obj *ensObjPtr, Tcl_Obj *objPtr)); -EXTERN int Itcl_EnsembleCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_EnsPartCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); -EXTERN int Itcl_EnsembleErrorCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); - - -/* - * Commands provided for backward compatibility + * Since the Tcl/Tk distribution doesn't perform any asserts, + * dynamic loading can fail to find the __assert function. + * As a workaround, we'll include our own. */ -EXTERN int Itcl_OldInit _ANSI_ARGS_((Tcl_Interp* interp, - ItclObjectInfo* info)); -EXTERN int Itcl_InstallOldBiMethods _ANSI_ARGS_((Tcl_Interp *interp, - ItclClass *cdefn)); - -/* - * Things that should be in the Tcl core. - */ -EXTERN Tcl_CallFrame* _Tcl_GetCallFrame _ANSI_ARGS_((Tcl_Interp *interp, - int level)); -EXTERN Tcl_CallFrame* _Tcl_ActivateCallFrame _ANSI_ARGS_((Tcl_Interp *interp, - Tcl_CallFrame *framePtr)); -EXTERN Var* _TclNewVar _ANSI_ARGS_((void)); +#undef assert +#ifdef NDEBUG +#define assert(EX) ((void)0) +#else +#if defined(__STDC__) +#define assert(EX) (void)((EX) || (Itcl_Assert(#EX, __FILE__, __LINE__), 0)) +#else +#define assert(EX) (void)((EX) || (Itcl_Assert("EX", __FILE__, __LINE__), 0)) +#endif /* __STDC__ */ +#endif /* NDEBUG */ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT diff --git a/itcl/itcl/generic/itclIntDecls.h b/itcl/itcl/generic/itclIntDecls.h new file mode 100644 index 00000000000..fa4989a80a9 --- /dev/null +++ b/itcl/itcl/generic/itclIntDecls.h @@ -0,0 +1,1048 @@ +/* + * itclIntDecls.h -- + * + * This file contains the declarations for all unsupported + * functions that are exported by the Tcl library. These + * interfaces are not guaranteed to remain the same between + * versions. Use at your own risk. + * + * Copyright (c) 1998-1999 by XXXX + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: $Id$ + */ + +#ifndef _ITCLINTDECLS +#define _ITCLINTDECLS + +/* + * WARNING: This file is automatically generated by the tools/genStubs.tcl + * script. Any modifications to the function declarations below should be made + * in the itcl/generic/tclInt.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +/* + * Exported function declarations: + */ + +/* 0 */ +EXTERN int Itcl_IsClassNamespace _ANSI_ARGS_(( + Tcl_Namespace * namesp)); +/* 1 */ +EXTERN int Itcl_IsClass _ANSI_ARGS_((Tcl_Command cmd)); +/* 2 */ +EXTERN ItclClass* Itcl_FindClass _ANSI_ARGS_((Tcl_Interp* interp, + char* path, int autoload)); +/* 3 */ +EXTERN int Itcl_FindObject _ANSI_ARGS_((Tcl_Interp * interp, + char * name, ItclObject ** roPtr)); +/* 4 */ +EXTERN int Itcl_IsObject _ANSI_ARGS_((Tcl_Command cmd)); +/* 5 */ +EXTERN int Itcl_ObjectIsa _ANSI_ARGS_((ItclObject * contextObj, + ItclClass * cdefn)); +/* 6 */ +EXTERN int Itcl_Protection _ANSI_ARGS_((Tcl_Interp * interp, + int newLevel)); +/* 7 */ +EXTERN char* Itcl_ProtectionStr _ANSI_ARGS_((int pLevel)); +/* 8 */ +EXTERN int Itcl_CanAccess _ANSI_ARGS_((ItclMember* memberPtr, + Tcl_Namespace* fromNsPtr)); +/* 9 */ +EXTERN int Itcl_CanAccessFunc _ANSI_ARGS_(( + ItclMemberFunc* mfunc, + Tcl_Namespace* fromNsPtr)); +/* 10 */ +EXTERN Tcl_Namespace* Itcl_GetTrueNamespace _ANSI_ARGS_(( + Tcl_Interp * interp, ItclObjectInfo * info)); +/* 11 */ +EXTERN void Itcl_ParseNamespPath _ANSI_ARGS_((char * name, + Tcl_DString * buffer, char ** head, + char ** tail)); +/* 12 */ +EXTERN int Itcl_DecodeScopedCommand _ANSI_ARGS_(( + Tcl_Interp * interp, char * name, + Tcl_Namespace ** rNsPtr, char ** rCmdPtr)); +/* 13 */ +EXTERN int Itcl_EvalArgs _ANSI_ARGS_((Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 14 */ +EXTERN Tcl_Obj* Itcl_CreateArgs _ANSI_ARGS_((Tcl_Interp * interp, + char * string, int objc, + Tcl_Obj *CONST objv[])); +/* 15 */ +EXTERN int Itcl_PushContext _ANSI_ARGS_((Tcl_Interp * interp, + ItclMember * member, + ItclClass * contextClass, + ItclObject * contextObj, + ItclContext * contextPtr)); +/* 16 */ +EXTERN void Itcl_PopContext _ANSI_ARGS_((Tcl_Interp * interp, + ItclContext * contextPtr)); +/* 17 */ +EXTERN int Itcl_GetContext _ANSI_ARGS_((Tcl_Interp * interp, + ItclClass ** cdefnPtr, + ItclObject ** odefnPtr)); +/* 18 */ +EXTERN void Itcl_InitHierIter _ANSI_ARGS_((ItclHierIter * iter, + ItclClass * cdefn)); +/* 19 */ +EXTERN void Itcl_DeleteHierIter _ANSI_ARGS_((ItclHierIter * iter)); +/* 20 */ +EXTERN ItclClass* Itcl_AdvanceHierIter _ANSI_ARGS_(( + ItclHierIter * iter)); +/* 21 */ +EXTERN int Itcl_FindClassesCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 22 */ +EXTERN int Itcl_FindObjectsCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 23 */ +EXTERN int Itcl_ProtectionCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 24 */ +EXTERN int Itcl_DelClassCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 25 */ +EXTERN int Itcl_DelObjectCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 26 */ +EXTERN int Itcl_ScopeCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 27 */ +EXTERN int Itcl_CodeCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 28 */ +EXTERN int Itcl_StubCreateCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 29 */ +EXTERN int Itcl_StubExistsCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 30 */ +EXTERN int Itcl_IsStub _ANSI_ARGS_((Tcl_Command cmd)); +/* 31 */ +EXTERN int Itcl_CreateClass _ANSI_ARGS_((Tcl_Interp* interp, + char* path, ItclObjectInfo * info, + ItclClass ** rPtr)); +/* 32 */ +EXTERN int Itcl_DeleteClass _ANSI_ARGS_((Tcl_Interp * interp, + ItclClass * cdefnPtr)); +/* 33 */ +EXTERN Tcl_Namespace* Itcl_FindClassNamespace _ANSI_ARGS_(( + Tcl_Interp* interp, char* path)); +/* 34 */ +EXTERN int Itcl_HandleClass _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 35 */ +EXTERN int Itcl_ClassCmdResolver _ANSI_ARGS_(( + Tcl_Interp * interp, char* name, + Tcl_Namespace * context, int flags, + Tcl_Command * rPtr)); +/* 36 */ +EXTERN int Itcl_ClassVarResolver _ANSI_ARGS_(( + Tcl_Interp * interp, char* name, + Tcl_Namespace * context, int flags, + Tcl_Var * rPtr)); +/* 37 */ +EXTERN int Itcl_ClassCompiledVarResolver _ANSI_ARGS_(( + Tcl_Interp * interp, char* name, int length, + Tcl_Namespace * context, + Tcl_ResolvedVarInfo ** rPtr)); +/* 38 */ +EXTERN void Itcl_BuildVirtualTables _ANSI_ARGS_(( + ItclClass* cdefnPtr)); +/* 39 */ +EXTERN int Itcl_CreateVarDefn _ANSI_ARGS_((Tcl_Interp * interp, + ItclClass* cdefn, char* name, char* init, + char* config, ItclVarDefn** vdefnPtr)); +/* 40 */ +EXTERN void Itcl_DeleteVarDefn _ANSI_ARGS_((ItclVarDefn * vdefn)); +/* 41 */ +EXTERN char* Itcl_GetCommonVar _ANSI_ARGS_((Tcl_Interp * interp, + char * name, ItclClass * contextClass)); +/* 42 */ +EXTERN ItclMember* Itcl_CreateMember _ANSI_ARGS_((Tcl_Interp* interp, + ItclClass * cdefn, char* name)); +/* 43 */ +EXTERN void Itcl_DeleteMember _ANSI_ARGS_((ItclMember * memPtr)); +/* 44 */ +EXTERN int Itcl_CreateObject _ANSI_ARGS_((Tcl_Interp * interp, + char* name, ItclClass * cdefn, int objc, + Tcl_Obj *CONST objv[], ItclObject ** roPtr)); +/* 45 */ +EXTERN int Itcl_DeleteObject _ANSI_ARGS_((Tcl_Interp * interp, + ItclObject * contextObj)); +/* 46 */ +EXTERN int Itcl_DestructObject _ANSI_ARGS_((Tcl_Interp * interp, + ItclObject * contextObj, int flags)); +/* 47 */ +EXTERN int Itcl_HandleInstance _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 48 */ +EXTERN char* Itcl_GetInstanceVar _ANSI_ARGS_((Tcl_Interp * interp, + char * name, ItclObject * contextObj, + ItclClass * contextClass)); +/* 49 */ +EXTERN int Itcl_ScopedVarResolver _ANSI_ARGS_(( + Tcl_Interp * interp, char * name, + Tcl_Namespace * contextNs, int flags, + Tcl_Var * rPtr)); +/* 50 */ +EXTERN int Itcl_BodyCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 51 */ +EXTERN int Itcl_ConfigBodyCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 52 */ +EXTERN int Itcl_CreateMethod _ANSI_ARGS_((Tcl_Interp* interp, + ItclClass * cdefn, char* name, char* arglist, + char* body)); +/* 53 */ +EXTERN int Itcl_CreateProc _ANSI_ARGS_((Tcl_Interp* interp, + ItclClass * cdefn, char* name, char* arglist, + char* body)); +/* 54 */ +EXTERN int Itcl_CreateMemberFunc _ANSI_ARGS_(( + Tcl_Interp* interp, ItclClass * cdefn, + char* name, char* arglist, char* body, + ItclMemberFunc** mfuncPtr)); +/* 55 */ +EXTERN int Itcl_ChangeMemberFunc _ANSI_ARGS_(( + Tcl_Interp* interp, ItclMemberFunc* mfunc, + char* arglist, char* body)); +/* 56 */ +EXTERN void Itcl_DeleteMemberFunc _ANSI_ARGS_((char* cdata)); +/* 57 */ +EXTERN int Itcl_CreateMemberCode _ANSI_ARGS_(( + Tcl_Interp* interp, ItclClass * cdefn, + char* arglist, char* body, + ItclMemberCode** mcodePtr)); +/* 58 */ +EXTERN void Itcl_DeleteMemberCode _ANSI_ARGS_((char* cdata)); +/* 59 */ +EXTERN int Itcl_GetMemberCode _ANSI_ARGS_((Tcl_Interp* interp, + ItclMember* member)); +/* Slot 60 is reserved */ +/* 61 */ +EXTERN int Itcl_EvalMemberCode _ANSI_ARGS_((Tcl_Interp * interp, + ItclMemberFunc * mfunc, ItclMember * member, + ItclObject * contextObj, int objc, + Tcl_Obj *CONST objv[])); +/* 62 */ +EXTERN int Itcl_CreateArgList _ANSI_ARGS_((Tcl_Interp* interp, + char* decl, int* argcPtr, + CompiledLocal** argPtr)); +/* 63 */ +EXTERN CompiledLocal* Itcl_CreateArg _ANSI_ARGS_((char* name, char* init)); +/* 64 */ +EXTERN void Itcl_DeleteArgList _ANSI_ARGS_(( + CompiledLocal * arglist)); +/* 65 */ +EXTERN Tcl_Obj* Itcl_ArgList _ANSI_ARGS_((int argc, + CompiledLocal* arglist)); +/* 66 */ +EXTERN int Itcl_EquivArgLists _ANSI_ARGS_((CompiledLocal* arg1, + int arg1c, CompiledLocal* arg2, int arg2c)); +/* 67 */ +EXTERN void Itcl_GetMemberFuncUsage _ANSI_ARGS_(( + ItclMemberFunc * mfunc, + ItclObject * contextObj, Tcl_Obj * objPtr)); +/* 68 */ +EXTERN int Itcl_ExecMethod _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 69 */ +EXTERN int Itcl_ExecProc _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 70 */ +EXTERN int Itcl_AssignArgs _ANSI_ARGS_((Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[], + ItclMemberFunc * mfunc)); +/* 71 */ +EXTERN int Itcl_ConstructBase _ANSI_ARGS_((Tcl_Interp * interp, + ItclObject * contextObj, + ItclClass * contextClass)); +/* 72 */ +EXTERN int Itcl_InvokeMethodIfExists _ANSI_ARGS_(( + Tcl_Interp * interp, char * name, + ItclClass * contextClass, + ItclObject * contextObj, int objc, + Tcl_Obj *CONST objv[])); +/* Slot 73 is reserved */ +/* 74 */ +EXTERN int Itcl_ReportFuncErrors _ANSI_ARGS_(( + Tcl_Interp* interp, ItclMemberFunc * mfunc, + ItclObject * contextObj, int result)); +/* 75 */ +EXTERN int Itcl_ParseInit _ANSI_ARGS_((Tcl_Interp * interp, + ItclObjectInfo * info)); +/* 76 */ +EXTERN int Itcl_ClassCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 77 */ +EXTERN int Itcl_ClassInheritCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 78 */ +EXTERN int Itcl_ClassProtectionCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 79 */ +EXTERN int Itcl_ClassConstructorCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 80 */ +EXTERN int Itcl_ClassDestructorCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 81 */ +EXTERN int Itcl_ClassMethodCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 82 */ +EXTERN int Itcl_ClassProcCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 83 */ +EXTERN int Itcl_ClassVariableCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 84 */ +EXTERN int Itcl_ClassCommonCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 85 */ +EXTERN int Itcl_ParseVarResolver _ANSI_ARGS_(( + Tcl_Interp * interp, char* name, + Tcl_Namespace * contextNs, int flags, + Tcl_Var* rPtr)); +/* 86 */ +EXTERN int Itcl_BiInit _ANSI_ARGS_((Tcl_Interp * interp)); +/* 87 */ +EXTERN int Itcl_InstallBiMethods _ANSI_ARGS_(( + Tcl_Interp * interp, ItclClass * cdefn)); +/* 88 */ +EXTERN int Itcl_BiIsaCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 89 */ +EXTERN int Itcl_BiConfigureCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 90 */ +EXTERN int Itcl_BiCgetCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 91 */ +EXTERN int Itcl_BiChainCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 92 */ +EXTERN int Itcl_BiInfoClassCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 93 */ +EXTERN int Itcl_BiInfoInheritCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 94 */ +EXTERN int Itcl_BiInfoHeritageCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 95 */ +EXTERN int Itcl_BiInfoFunctionCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 96 */ +EXTERN int Itcl_BiInfoVariableCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 97 */ +EXTERN int Itcl_BiInfoBodyCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 98 */ +EXTERN int Itcl_BiInfoArgsCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 99 */ +EXTERN int Itcl_DefaultInfoCmd _ANSI_ARGS_((ClientData dummy, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 100 */ +EXTERN int Itcl_EnsembleInit _ANSI_ARGS_((Tcl_Interp * interp)); +/* 101 */ +EXTERN int Itcl_CreateEnsemble _ANSI_ARGS_((Tcl_Interp * interp, + char* ensName)); +/* 102 */ +EXTERN int Itcl_AddEnsemblePart _ANSI_ARGS_(( + Tcl_Interp * interp, char* ensName, + char* partName, char* usageInfo, + Tcl_ObjCmdProc * objProc, + ClientData clientData, + Tcl_CmdDeleteProc * deleteProc)); +/* 103 */ +EXTERN int Itcl_GetEnsemblePart _ANSI_ARGS_(( + Tcl_Interp * interp, char * ensName, + char * partName, Tcl_CmdInfo * infoPtr)); +/* 104 */ +EXTERN int Itcl_IsEnsemble _ANSI_ARGS_((Tcl_CmdInfo* infoPtr)); +/* 105 */ +EXTERN int Itcl_GetEnsembleUsage _ANSI_ARGS_(( + Tcl_Interp * interp, char * ensName, + Tcl_Obj * objPtr)); +/* 106 */ +EXTERN int Itcl_GetEnsembleUsageForObj _ANSI_ARGS_(( + Tcl_Interp * interp, Tcl_Obj * ensObjPtr, + Tcl_Obj * objPtr)); +/* 107 */ +EXTERN int Itcl_EnsembleCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 108 */ +EXTERN int Itcl_EnsPartCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp * interp, int objc, + Tcl_Obj *CONST objv[])); +/* 109 */ +EXTERN int Itcl_EnsembleErrorCmd _ANSI_ARGS_(( + ClientData clientData, Tcl_Interp * interp, + int objc, Tcl_Obj *CONST objv[])); +/* 110 */ +EXTERN int Itcl_OldInit _ANSI_ARGS_((Tcl_Interp* interp, + ItclObjectInfo* info)); +/* 111 */ +EXTERN int Itcl_InstallOldBiMethods _ANSI_ARGS_(( + Tcl_Interp * interp, ItclClass * cdefn)); +/* 112 */ +EXTERN Tcl_CallFrame* _Tcl_GetCallFrame _ANSI_ARGS_((Tcl_Interp * interp, + int level)); +/* 113 */ +EXTERN Tcl_CallFrame* _Tcl_ActivateCallFrame _ANSI_ARGS_(( + Tcl_Interp * interp, + Tcl_CallFrame * framePtr)); +/* 114 */ +EXTERN Var* _TclNewVar _ANSI_ARGS_((void)); +/* 115 */ +EXTERN void Itcl_Assert _ANSI_ARGS_((char * testExpr, + char * fileName, int lineNum)); + +typedef struct ItclIntStubs { + int magic; + struct ItclIntStubHooks *hooks; + + int (*itcl_IsClassNamespace) _ANSI_ARGS_((Tcl_Namespace * namesp)); /* 0 */ + int (*itcl_IsClass) _ANSI_ARGS_((Tcl_Command cmd)); /* 1 */ + ItclClass* (*itcl_FindClass) _ANSI_ARGS_((Tcl_Interp* interp, char* path, int autoload)); /* 2 */ + int (*itcl_FindObject) _ANSI_ARGS_((Tcl_Interp * interp, char * name, ItclObject ** roPtr)); /* 3 */ + int (*itcl_IsObject) _ANSI_ARGS_((Tcl_Command cmd)); /* 4 */ + int (*itcl_ObjectIsa) _ANSI_ARGS_((ItclObject * contextObj, ItclClass * cdefn)); /* 5 */ + int (*itcl_Protection) _ANSI_ARGS_((Tcl_Interp * interp, int newLevel)); /* 6 */ + char* (*itcl_ProtectionStr) _ANSI_ARGS_((int pLevel)); /* 7 */ + int (*itcl_CanAccess) _ANSI_ARGS_((ItclMember* memberPtr, Tcl_Namespace* fromNsPtr)); /* 8 */ + int (*itcl_CanAccessFunc) _ANSI_ARGS_((ItclMemberFunc* mfunc, Tcl_Namespace* fromNsPtr)); /* 9 */ + Tcl_Namespace* (*itcl_GetTrueNamespace) _ANSI_ARGS_((Tcl_Interp * interp, ItclObjectInfo * info)); /* 10 */ + void (*itcl_ParseNamespPath) _ANSI_ARGS_((char * name, Tcl_DString * buffer, char ** head, char ** tail)); /* 11 */ + int (*itcl_DecodeScopedCommand) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_Namespace ** rNsPtr, char ** rCmdPtr)); /* 12 */ + int (*itcl_EvalArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 13 */ + Tcl_Obj* (*itcl_CreateArgs) _ANSI_ARGS_((Tcl_Interp * interp, char * string, int objc, Tcl_Obj *CONST objv[])); /* 14 */ + int (*itcl_PushContext) _ANSI_ARGS_((Tcl_Interp * interp, ItclMember * member, ItclClass * contextClass, ItclObject * contextObj, ItclContext * contextPtr)); /* 15 */ + void (*itcl_PopContext) _ANSI_ARGS_((Tcl_Interp * interp, ItclContext * contextPtr)); /* 16 */ + int (*itcl_GetContext) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass ** cdefnPtr, ItclObject ** odefnPtr)); /* 17 */ + void (*itcl_InitHierIter) _ANSI_ARGS_((ItclHierIter * iter, ItclClass * cdefn)); /* 18 */ + void (*itcl_DeleteHierIter) _ANSI_ARGS_((ItclHierIter * iter)); /* 19 */ + ItclClass* (*itcl_AdvanceHierIter) _ANSI_ARGS_((ItclHierIter * iter)); /* 20 */ + int (*itcl_FindClassesCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 21 */ + int (*itcl_FindObjectsCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 22 */ + int (*itcl_ProtectionCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 23 */ + int (*itcl_DelClassCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 24 */ + int (*itcl_DelObjectCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 25 */ + int (*itcl_ScopeCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 26 */ + int (*itcl_CodeCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 27 */ + int (*itcl_StubCreateCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 28 */ + int (*itcl_StubExistsCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 29 */ + int (*itcl_IsStub) _ANSI_ARGS_((Tcl_Command cmd)); /* 30 */ + int (*itcl_CreateClass) _ANSI_ARGS_((Tcl_Interp* interp, char* path, ItclObjectInfo * info, ItclClass ** rPtr)); /* 31 */ + int (*itcl_DeleteClass) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefnPtr)); /* 32 */ + Tcl_Namespace* (*itcl_FindClassNamespace) _ANSI_ARGS_((Tcl_Interp* interp, char* path)); /* 33 */ + int (*itcl_HandleClass) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 34 */ + int (*itcl_ClassCmdResolver) _ANSI_ARGS_((Tcl_Interp * interp, char* name, Tcl_Namespace * context, int flags, Tcl_Command * rPtr)); /* 35 */ + int (*itcl_ClassVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, char* name, Tcl_Namespace * context, int flags, Tcl_Var * rPtr)); /* 36 */ + int (*itcl_ClassCompiledVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, char* name, int length, Tcl_Namespace * context, Tcl_ResolvedVarInfo ** rPtr)); /* 37 */ + void (*itcl_BuildVirtualTables) _ANSI_ARGS_((ItclClass* cdefnPtr)); /* 38 */ + int (*itcl_CreateVarDefn) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass* cdefn, char* name, char* init, char* config, ItclVarDefn** vdefnPtr)); /* 39 */ + void (*itcl_DeleteVarDefn) _ANSI_ARGS_((ItclVarDefn * vdefn)); /* 40 */ + char* (*itcl_GetCommonVar) _ANSI_ARGS_((Tcl_Interp * interp, char * name, ItclClass * contextClass)); /* 41 */ + ItclMember* (*itcl_CreateMember) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, char* name)); /* 42 */ + void (*itcl_DeleteMember) _ANSI_ARGS_((ItclMember * memPtr)); /* 43 */ + int (*itcl_CreateObject) _ANSI_ARGS_((Tcl_Interp * interp, char* name, ItclClass * cdefn, int objc, Tcl_Obj *CONST objv[], ItclObject ** roPtr)); /* 44 */ + int (*itcl_DeleteObject) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj)); /* 45 */ + int (*itcl_DestructObject) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj, int flags)); /* 46 */ + int (*itcl_HandleInstance) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 47 */ + char* (*itcl_GetInstanceVar) _ANSI_ARGS_((Tcl_Interp * interp, char * name, ItclObject * contextObj, ItclClass * contextClass)); /* 48 */ + int (*itcl_ScopedVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, char * name, Tcl_Namespace * contextNs, int flags, Tcl_Var * rPtr)); /* 49 */ + int (*itcl_BodyCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 50 */ + int (*itcl_ConfigBodyCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 51 */ + int (*itcl_CreateMethod) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, char* name, char* arglist, char* body)); /* 52 */ + int (*itcl_CreateProc) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, char* name, char* arglist, char* body)); /* 53 */ + int (*itcl_CreateMemberFunc) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, char* name, char* arglist, char* body, ItclMemberFunc** mfuncPtr)); /* 54 */ + int (*itcl_ChangeMemberFunc) _ANSI_ARGS_((Tcl_Interp* interp, ItclMemberFunc* mfunc, char* arglist, char* body)); /* 55 */ + void (*itcl_DeleteMemberFunc) _ANSI_ARGS_((char* cdata)); /* 56 */ + int (*itcl_CreateMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclClass * cdefn, char* arglist, char* body, ItclMemberCode** mcodePtr)); /* 57 */ + void (*itcl_DeleteMemberCode) _ANSI_ARGS_((char* cdata)); /* 58 */ + int (*itcl_GetMemberCode) _ANSI_ARGS_((Tcl_Interp* interp, ItclMember* member)); /* 59 */ + void *reserved60; + int (*itcl_EvalMemberCode) _ANSI_ARGS_((Tcl_Interp * interp, ItclMemberFunc * mfunc, ItclMember * member, ItclObject * contextObj, int objc, Tcl_Obj *CONST objv[])); /* 61 */ + int (*itcl_CreateArgList) _ANSI_ARGS_((Tcl_Interp* interp, char* decl, int* argcPtr, CompiledLocal** argPtr)); /* 62 */ + CompiledLocal* (*itcl_CreateArg) _ANSI_ARGS_((char* name, char* init)); /* 63 */ + void (*itcl_DeleteArgList) _ANSI_ARGS_((CompiledLocal * arglist)); /* 64 */ + Tcl_Obj* (*itcl_ArgList) _ANSI_ARGS_((int argc, CompiledLocal* arglist)); /* 65 */ + int (*itcl_EquivArgLists) _ANSI_ARGS_((CompiledLocal* arg1, int arg1c, CompiledLocal* arg2, int arg2c)); /* 66 */ + void (*itcl_GetMemberFuncUsage) _ANSI_ARGS_((ItclMemberFunc * mfunc, ItclObject * contextObj, Tcl_Obj * objPtr)); /* 67 */ + int (*itcl_ExecMethod) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 68 */ + int (*itcl_ExecProc) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 69 */ + int (*itcl_AssignArgs) _ANSI_ARGS_((Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[], ItclMemberFunc * mfunc)); /* 70 */ + int (*itcl_ConstructBase) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj, ItclClass * contextClass)); /* 71 */ + int (*itcl_InvokeMethodIfExists) _ANSI_ARGS_((Tcl_Interp * interp, char * name, ItclClass * contextClass, ItclObject * contextObj, int objc, Tcl_Obj *CONST objv[])); /* 72 */ + void *reserved73; + int (*itcl_ReportFuncErrors) _ANSI_ARGS_((Tcl_Interp* interp, ItclMemberFunc * mfunc, ItclObject * contextObj, int result)); /* 74 */ + int (*itcl_ParseInit) _ANSI_ARGS_((Tcl_Interp * interp, ItclObjectInfo * info)); /* 75 */ + int (*itcl_ClassCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 76 */ + int (*itcl_ClassInheritCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 77 */ + int (*itcl_ClassProtectionCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 78 */ + int (*itcl_ClassConstructorCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 79 */ + int (*itcl_ClassDestructorCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 80 */ + int (*itcl_ClassMethodCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 81 */ + int (*itcl_ClassProcCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 82 */ + int (*itcl_ClassVariableCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 83 */ + int (*itcl_ClassCommonCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 84 */ + int (*itcl_ParseVarResolver) _ANSI_ARGS_((Tcl_Interp * interp, char* name, Tcl_Namespace * contextNs, int flags, Tcl_Var* rPtr)); /* 85 */ + int (*itcl_BiInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 86 */ + int (*itcl_InstallBiMethods) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn)); /* 87 */ + int (*itcl_BiIsaCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 88 */ + int (*itcl_BiConfigureCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 89 */ + int (*itcl_BiCgetCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 90 */ + int (*itcl_BiChainCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 91 */ + int (*itcl_BiInfoClassCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 92 */ + int (*itcl_BiInfoInheritCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 93 */ + int (*itcl_BiInfoHeritageCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 94 */ + int (*itcl_BiInfoFunctionCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 95 */ + int (*itcl_BiInfoVariableCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 96 */ + int (*itcl_BiInfoBodyCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 97 */ + int (*itcl_BiInfoArgsCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 98 */ + int (*itcl_DefaultInfoCmd) _ANSI_ARGS_((ClientData dummy, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 99 */ + int (*itcl_EnsembleInit) _ANSI_ARGS_((Tcl_Interp * interp)); /* 100 */ + int (*itcl_CreateEnsemble) _ANSI_ARGS_((Tcl_Interp * interp, char* ensName)); /* 101 */ + int (*itcl_AddEnsemblePart) _ANSI_ARGS_((Tcl_Interp * interp, char* ensName, char* partName, char* usageInfo, Tcl_ObjCmdProc * objProc, ClientData clientData, Tcl_CmdDeleteProc * deleteProc)); /* 102 */ + int (*itcl_GetEnsemblePart) _ANSI_ARGS_((Tcl_Interp * interp, char * ensName, char * partName, Tcl_CmdInfo * infoPtr)); /* 103 */ + int (*itcl_IsEnsemble) _ANSI_ARGS_((Tcl_CmdInfo* infoPtr)); /* 104 */ + int (*itcl_GetEnsembleUsage) _ANSI_ARGS_((Tcl_Interp * interp, char * ensName, Tcl_Obj * objPtr)); /* 105 */ + int (*itcl_GetEnsembleUsageForObj) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_Obj * ensObjPtr, Tcl_Obj * objPtr)); /* 106 */ + int (*itcl_EnsembleCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 107 */ + int (*itcl_EnsPartCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 108 */ + int (*itcl_EnsembleErrorCmd) _ANSI_ARGS_((ClientData clientData, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 109 */ + int (*itcl_OldInit) _ANSI_ARGS_((Tcl_Interp* interp, ItclObjectInfo* info)); /* 110 */ + int (*itcl_InstallOldBiMethods) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn)); /* 111 */ + Tcl_CallFrame* (*_Tcl_GetCallFrame) _ANSI_ARGS_((Tcl_Interp * interp, int level)); /* 112 */ + Tcl_CallFrame* (*_Tcl_ActivateCallFrame) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_CallFrame * framePtr)); /* 113 */ + Var* (*_TclNewVar) _ANSI_ARGS_((void)); /* 114 */ + void (*itcl_Assert) _ANSI_ARGS_((char * testExpr, char * fileName, int lineNum)); /* 115 */ +} ItclIntStubs; + +#ifdef __cplusplus +extern "C" { +#endif +extern ItclIntStubs *itclIntStubsPtr; +#ifdef __cplusplus +} +#endif + +#if defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) + +/* + * Inline function declarations: + */ + +#ifndef Itcl_IsClassNamespace +#define Itcl_IsClassNamespace \ + (itclIntStubsPtr->itcl_IsClassNamespace) /* 0 */ +#endif +#ifndef Itcl_IsClass +#define Itcl_IsClass \ + (itclIntStubsPtr->itcl_IsClass) /* 1 */ +#endif +#ifndef Itcl_FindClass +#define Itcl_FindClass \ + (itclIntStubsPtr->itcl_FindClass) /* 2 */ +#endif +#ifndef Itcl_FindObject +#define Itcl_FindObject \ + (itclIntStubsPtr->itcl_FindObject) /* 3 */ +#endif +#ifndef Itcl_IsObject +#define Itcl_IsObject \ + (itclIntStubsPtr->itcl_IsObject) /* 4 */ +#endif +#ifndef Itcl_ObjectIsa +#define Itcl_ObjectIsa \ + (itclIntStubsPtr->itcl_ObjectIsa) /* 5 */ +#endif +#ifndef Itcl_Protection +#define Itcl_Protection \ + (itclIntStubsPtr->itcl_Protection) /* 6 */ +#endif +#ifndef Itcl_ProtectionStr +#define Itcl_ProtectionStr \ + (itclIntStubsPtr->itcl_ProtectionStr) /* 7 */ +#endif +#ifndef Itcl_CanAccess +#define Itcl_CanAccess \ + (itclIntStubsPtr->itcl_CanAccess) /* 8 */ +#endif +#ifndef Itcl_CanAccessFunc +#define Itcl_CanAccessFunc \ + (itclIntStubsPtr->itcl_CanAccessFunc) /* 9 */ +#endif +#ifndef Itcl_GetTrueNamespace +#define Itcl_GetTrueNamespace \ + (itclIntStubsPtr->itcl_GetTrueNamespace) /* 10 */ +#endif +#ifndef Itcl_ParseNamespPath +#define Itcl_ParseNamespPath \ + (itclIntStubsPtr->itcl_ParseNamespPath) /* 11 */ +#endif +#ifndef Itcl_DecodeScopedCommand +#define Itcl_DecodeScopedCommand \ + (itclIntStubsPtr->itcl_DecodeScopedCommand) /* 12 */ +#endif +#ifndef Itcl_EvalArgs +#define Itcl_EvalArgs \ + (itclIntStubsPtr->itcl_EvalArgs) /* 13 */ +#endif +#ifndef Itcl_CreateArgs +#define Itcl_CreateArgs \ + (itclIntStubsPtr->itcl_CreateArgs) /* 14 */ +#endif +#ifndef Itcl_PushContext +#define Itcl_PushContext \ + (itclIntStubsPtr->itcl_PushContext) /* 15 */ +#endif +#ifndef Itcl_PopContext +#define Itcl_PopContext \ + (itclIntStubsPtr->itcl_PopContext) /* 16 */ +#endif +#ifndef Itcl_GetContext +#define Itcl_GetContext \ + (itclIntStubsPtr->itcl_GetContext) /* 17 */ +#endif +#ifndef Itcl_InitHierIter +#define Itcl_InitHierIter \ + (itclIntStubsPtr->itcl_InitHierIter) /* 18 */ +#endif +#ifndef Itcl_DeleteHierIter +#define Itcl_DeleteHierIter \ + (itclIntStubsPtr->itcl_DeleteHierIter) /* 19 */ +#endif +#ifndef Itcl_AdvanceHierIter +#define Itcl_AdvanceHierIter \ + (itclIntStubsPtr->itcl_AdvanceHierIter) /* 20 */ +#endif +#ifndef Itcl_FindClassesCmd +#define Itcl_FindClassesCmd \ + (itclIntStubsPtr->itcl_FindClassesCmd) /* 21 */ +#endif +#ifndef Itcl_FindObjectsCmd +#define Itcl_FindObjectsCmd \ + (itclIntStubsPtr->itcl_FindObjectsCmd) /* 22 */ +#endif +#ifndef Itcl_ProtectionCmd +#define Itcl_ProtectionCmd \ + (itclIntStubsPtr->itcl_ProtectionCmd) /* 23 */ +#endif +#ifndef Itcl_DelClassCmd +#define Itcl_DelClassCmd \ + (itclIntStubsPtr->itcl_DelClassCmd) /* 24 */ +#endif +#ifndef Itcl_DelObjectCmd +#define Itcl_DelObjectCmd \ + (itclIntStubsPtr->itcl_DelObjectCmd) /* 25 */ +#endif +#ifndef Itcl_ScopeCmd +#define Itcl_ScopeCmd \ + (itclIntStubsPtr->itcl_ScopeCmd) /* 26 */ +#endif +#ifndef Itcl_CodeCmd +#define Itcl_CodeCmd \ + (itclIntStubsPtr->itcl_CodeCmd) /* 27 */ +#endif +#ifndef Itcl_StubCreateCmd +#define Itcl_StubCreateCmd \ + (itclIntStubsPtr->itcl_StubCreateCmd) /* 28 */ +#endif +#ifndef Itcl_StubExistsCmd +#define Itcl_StubExistsCmd \ + (itclIntStubsPtr->itcl_StubExistsCmd) /* 29 */ +#endif +#ifndef Itcl_IsStub +#define Itcl_IsStub \ + (itclIntStubsPtr->itcl_IsStub) /* 30 */ +#endif +#ifndef Itcl_CreateClass +#define Itcl_CreateClass \ + (itclIntStubsPtr->itcl_CreateClass) /* 31 */ +#endif +#ifndef Itcl_DeleteClass +#define Itcl_DeleteClass \ + (itclIntStubsPtr->itcl_DeleteClass) /* 32 */ +#endif +#ifndef Itcl_FindClassNamespace +#define Itcl_FindClassNamespace \ + (itclIntStubsPtr->itcl_FindClassNamespace) /* 33 */ +#endif +#ifndef Itcl_HandleClass +#define Itcl_HandleClass \ + (itclIntStubsPtr->itcl_HandleClass) /* 34 */ +#endif +#ifndef Itcl_ClassCmdResolver +#define Itcl_ClassCmdResolver \ + (itclIntStubsPtr->itcl_ClassCmdResolver) /* 35 */ +#endif +#ifndef Itcl_ClassVarResolver +#define Itcl_ClassVarResolver \ + (itclIntStubsPtr->itcl_ClassVarResolver) /* 36 */ +#endif +#ifndef Itcl_ClassCompiledVarResolver +#define Itcl_ClassCompiledVarResolver \ + (itclIntStubsPtr->itcl_ClassCompiledVarResolver) /* 37 */ +#endif +#ifndef Itcl_BuildVirtualTables +#define Itcl_BuildVirtualTables \ + (itclIntStubsPtr->itcl_BuildVirtualTables) /* 38 */ +#endif +#ifndef Itcl_CreateVarDefn +#define Itcl_CreateVarDefn \ + (itclIntStubsPtr->itcl_CreateVarDefn) /* 39 */ +#endif +#ifndef Itcl_DeleteVarDefn +#define Itcl_DeleteVarDefn \ + (itclIntStubsPtr->itcl_DeleteVarDefn) /* 40 */ +#endif +#ifndef Itcl_GetCommonVar +#define Itcl_GetCommonVar \ + (itclIntStubsPtr->itcl_GetCommonVar) /* 41 */ +#endif +#ifndef Itcl_CreateMember +#define Itcl_CreateMember \ + (itclIntStubsPtr->itcl_CreateMember) /* 42 */ +#endif +#ifndef Itcl_DeleteMember +#define Itcl_DeleteMember \ + (itclIntStubsPtr->itcl_DeleteMember) /* 43 */ +#endif +#ifndef Itcl_CreateObject +#define Itcl_CreateObject \ + (itclIntStubsPtr->itcl_CreateObject) /* 44 */ +#endif +#ifndef Itcl_DeleteObject +#define Itcl_DeleteObject \ + (itclIntStubsPtr->itcl_DeleteObject) /* 45 */ +#endif +#ifndef Itcl_DestructObject +#define Itcl_DestructObject \ + (itclIntStubsPtr->itcl_DestructObject) /* 46 */ +#endif +#ifndef Itcl_HandleInstance +#define Itcl_HandleInstance \ + (itclIntStubsPtr->itcl_HandleInstance) /* 47 */ +#endif +#ifndef Itcl_GetInstanceVar +#define Itcl_GetInstanceVar \ + (itclIntStubsPtr->itcl_GetInstanceVar) /* 48 */ +#endif +#ifndef Itcl_ScopedVarResolver +#define Itcl_ScopedVarResolver \ + (itclIntStubsPtr->itcl_ScopedVarResolver) /* 49 */ +#endif +#ifndef Itcl_BodyCmd +#define Itcl_BodyCmd \ + (itclIntStubsPtr->itcl_BodyCmd) /* 50 */ +#endif +#ifndef Itcl_ConfigBodyCmd +#define Itcl_ConfigBodyCmd \ + (itclIntStubsPtr->itcl_ConfigBodyCmd) /* 51 */ +#endif +#ifndef Itcl_CreateMethod +#define Itcl_CreateMethod \ + (itclIntStubsPtr->itcl_CreateMethod) /* 52 */ +#endif +#ifndef Itcl_CreateProc +#define Itcl_CreateProc \ + (itclIntStubsPtr->itcl_CreateProc) /* 53 */ +#endif +#ifndef Itcl_CreateMemberFunc +#define Itcl_CreateMemberFunc \ + (itclIntStubsPtr->itcl_CreateMemberFunc) /* 54 */ +#endif +#ifndef Itcl_ChangeMemberFunc +#define Itcl_ChangeMemberFunc \ + (itclIntStubsPtr->itcl_ChangeMemberFunc) /* 55 */ +#endif +#ifndef Itcl_DeleteMemberFunc +#define Itcl_DeleteMemberFunc \ + (itclIntStubsPtr->itcl_DeleteMemberFunc) /* 56 */ +#endif +#ifndef Itcl_CreateMemberCode +#define Itcl_CreateMemberCode \ + (itclIntStubsPtr->itcl_CreateMemberCode) /* 57 */ +#endif +#ifndef Itcl_DeleteMemberCode +#define Itcl_DeleteMemberCode \ + (itclIntStubsPtr->itcl_DeleteMemberCode) /* 58 */ +#endif +#ifndef Itcl_GetMemberCode +#define Itcl_GetMemberCode \ + (itclIntStubsPtr->itcl_GetMemberCode) /* 59 */ +#endif +/* Slot 60 is reserved */ +#ifndef Itcl_EvalMemberCode +#define Itcl_EvalMemberCode \ + (itclIntStubsPtr->itcl_EvalMemberCode) /* 61 */ +#endif +#ifndef Itcl_CreateArgList +#define Itcl_CreateArgList \ + (itclIntStubsPtr->itcl_CreateArgList) /* 62 */ +#endif +#ifndef Itcl_CreateArg +#define Itcl_CreateArg \ + (itclIntStubsPtr->itcl_CreateArg) /* 63 */ +#endif +#ifndef Itcl_DeleteArgList +#define Itcl_DeleteArgList \ + (itclIntStubsPtr->itcl_DeleteArgList) /* 64 */ +#endif +#ifndef Itcl_ArgList +#define Itcl_ArgList \ + (itclIntStubsPtr->itcl_ArgList) /* 65 */ +#endif +#ifndef Itcl_EquivArgLists +#define Itcl_EquivArgLists \ + (itclIntStubsPtr->itcl_EquivArgLists) /* 66 */ +#endif +#ifndef Itcl_GetMemberFuncUsage +#define Itcl_GetMemberFuncUsage \ + (itclIntStubsPtr->itcl_GetMemberFuncUsage) /* 67 */ +#endif +#ifndef Itcl_ExecMethod +#define Itcl_ExecMethod \ + (itclIntStubsPtr->itcl_ExecMethod) /* 68 */ +#endif +#ifndef Itcl_ExecProc +#define Itcl_ExecProc \ + (itclIntStubsPtr->itcl_ExecProc) /* 69 */ +#endif +#ifndef Itcl_AssignArgs +#define Itcl_AssignArgs \ + (itclIntStubsPtr->itcl_AssignArgs) /* 70 */ +#endif +#ifndef Itcl_ConstructBase +#define Itcl_ConstructBase \ + (itclIntStubsPtr->itcl_ConstructBase) /* 71 */ +#endif +#ifndef Itcl_InvokeMethodIfExists +#define Itcl_InvokeMethodIfExists \ + (itclIntStubsPtr->itcl_InvokeMethodIfExists) /* 72 */ +#endif +/* Slot 73 is reserved */ +#ifndef Itcl_ReportFuncErrors +#define Itcl_ReportFuncErrors \ + (itclIntStubsPtr->itcl_ReportFuncErrors) /* 74 */ +#endif +#ifndef Itcl_ParseInit +#define Itcl_ParseInit \ + (itclIntStubsPtr->itcl_ParseInit) /* 75 */ +#endif +#ifndef Itcl_ClassCmd +#define Itcl_ClassCmd \ + (itclIntStubsPtr->itcl_ClassCmd) /* 76 */ +#endif +#ifndef Itcl_ClassInheritCmd +#define Itcl_ClassInheritCmd \ + (itclIntStubsPtr->itcl_ClassInheritCmd) /* 77 */ +#endif +#ifndef Itcl_ClassProtectionCmd +#define Itcl_ClassProtectionCmd \ + (itclIntStubsPtr->itcl_ClassProtectionCmd) /* 78 */ +#endif +#ifndef Itcl_ClassConstructorCmd +#define Itcl_ClassConstructorCmd \ + (itclIntStubsPtr->itcl_ClassConstructorCmd) /* 79 */ +#endif +#ifndef Itcl_ClassDestructorCmd +#define Itcl_ClassDestructorCmd \ + (itclIntStubsPtr->itcl_ClassDestructorCmd) /* 80 */ +#endif +#ifndef Itcl_ClassMethodCmd +#define Itcl_ClassMethodCmd \ + (itclIntStubsPtr->itcl_ClassMethodCmd) /* 81 */ +#endif +#ifndef Itcl_ClassProcCmd +#define Itcl_ClassProcCmd \ + (itclIntStubsPtr->itcl_ClassProcCmd) /* 82 */ +#endif +#ifndef Itcl_ClassVariableCmd +#define Itcl_ClassVariableCmd \ + (itclIntStubsPtr->itcl_ClassVariableCmd) /* 83 */ +#endif +#ifndef Itcl_ClassCommonCmd +#define Itcl_ClassCommonCmd \ + (itclIntStubsPtr->itcl_ClassCommonCmd) /* 84 */ +#endif +#ifndef Itcl_ParseVarResolver +#define Itcl_ParseVarResolver \ + (itclIntStubsPtr->itcl_ParseVarResolver) /* 85 */ +#endif +#ifndef Itcl_BiInit +#define Itcl_BiInit \ + (itclIntStubsPtr->itcl_BiInit) /* 86 */ +#endif +#ifndef Itcl_InstallBiMethods +#define Itcl_InstallBiMethods \ + (itclIntStubsPtr->itcl_InstallBiMethods) /* 87 */ +#endif +#ifndef Itcl_BiIsaCmd +#define Itcl_BiIsaCmd \ + (itclIntStubsPtr->itcl_BiIsaCmd) /* 88 */ +#endif +#ifndef Itcl_BiConfigureCmd +#define Itcl_BiConfigureCmd \ + (itclIntStubsPtr->itcl_BiConfigureCmd) /* 89 */ +#endif +#ifndef Itcl_BiCgetCmd +#define Itcl_BiCgetCmd \ + (itclIntStubsPtr->itcl_BiCgetCmd) /* 90 */ +#endif +#ifndef Itcl_BiChainCmd +#define Itcl_BiChainCmd \ + (itclIntStubsPtr->itcl_BiChainCmd) /* 91 */ +#endif +#ifndef Itcl_BiInfoClassCmd +#define Itcl_BiInfoClassCmd \ + (itclIntStubsPtr->itcl_BiInfoClassCmd) /* 92 */ +#endif +#ifndef Itcl_BiInfoInheritCmd +#define Itcl_BiInfoInheritCmd \ + (itclIntStubsPtr->itcl_BiInfoInheritCmd) /* 93 */ +#endif +#ifndef Itcl_BiInfoHeritageCmd +#define Itcl_BiInfoHeritageCmd \ + (itclIntStubsPtr->itcl_BiInfoHeritageCmd) /* 94 */ +#endif +#ifndef Itcl_BiInfoFunctionCmd +#define Itcl_BiInfoFunctionCmd \ + (itclIntStubsPtr->itcl_BiInfoFunctionCmd) /* 95 */ +#endif +#ifndef Itcl_BiInfoVariableCmd +#define Itcl_BiInfoVariableCmd \ + (itclIntStubsPtr->itcl_BiInfoVariableCmd) /* 96 */ +#endif +#ifndef Itcl_BiInfoBodyCmd +#define Itcl_BiInfoBodyCmd \ + (itclIntStubsPtr->itcl_BiInfoBodyCmd) /* 97 */ +#endif +#ifndef Itcl_BiInfoArgsCmd +#define Itcl_BiInfoArgsCmd \ + (itclIntStubsPtr->itcl_BiInfoArgsCmd) /* 98 */ +#endif +#ifndef Itcl_DefaultInfoCmd +#define Itcl_DefaultInfoCmd \ + (itclIntStubsPtr->itcl_DefaultInfoCmd) /* 99 */ +#endif +#ifndef Itcl_EnsembleInit +#define Itcl_EnsembleInit \ + (itclIntStubsPtr->itcl_EnsembleInit) /* 100 */ +#endif +#ifndef Itcl_CreateEnsemble +#define Itcl_CreateEnsemble \ + (itclIntStubsPtr->itcl_CreateEnsemble) /* 101 */ +#endif +#ifndef Itcl_AddEnsemblePart +#define Itcl_AddEnsemblePart \ + (itclIntStubsPtr->itcl_AddEnsemblePart) /* 102 */ +#endif +#ifndef Itcl_GetEnsemblePart +#define Itcl_GetEnsemblePart \ + (itclIntStubsPtr->itcl_GetEnsemblePart) /* 103 */ +#endif +#ifndef Itcl_IsEnsemble +#define Itcl_IsEnsemble \ + (itclIntStubsPtr->itcl_IsEnsemble) /* 104 */ +#endif +#ifndef Itcl_GetEnsembleUsage +#define Itcl_GetEnsembleUsage \ + (itclIntStubsPtr->itcl_GetEnsembleUsage) /* 105 */ +#endif +#ifndef Itcl_GetEnsembleUsageForObj +#define Itcl_GetEnsembleUsageForObj \ + (itclIntStubsPtr->itcl_GetEnsembleUsageForObj) /* 106 */ +#endif +#ifndef Itcl_EnsembleCmd +#define Itcl_EnsembleCmd \ + (itclIntStubsPtr->itcl_EnsembleCmd) /* 107 */ +#endif +#ifndef Itcl_EnsPartCmd +#define Itcl_EnsPartCmd \ + (itclIntStubsPtr->itcl_EnsPartCmd) /* 108 */ +#endif +#ifndef Itcl_EnsembleErrorCmd +#define Itcl_EnsembleErrorCmd \ + (itclIntStubsPtr->itcl_EnsembleErrorCmd) /* 109 */ +#endif +#ifndef Itcl_OldInit +#define Itcl_OldInit \ + (itclIntStubsPtr->itcl_OldInit) /* 110 */ +#endif +#ifndef Itcl_InstallOldBiMethods +#define Itcl_InstallOldBiMethods \ + (itclIntStubsPtr->itcl_InstallOldBiMethods) /* 111 */ +#endif +#ifndef _Tcl_GetCallFrame +#define _Tcl_GetCallFrame \ + (itclIntStubsPtr->_Tcl_GetCallFrame) /* 112 */ +#endif +#ifndef _Tcl_ActivateCallFrame +#define _Tcl_ActivateCallFrame \ + (itclIntStubsPtr->_Tcl_ActivateCallFrame) /* 113 */ +#endif +#ifndef _TclNewVar +#define _TclNewVar \ + (itclIntStubsPtr->_TclNewVar) /* 114 */ +#endif +#ifndef Itcl_Assert +#define Itcl_Assert \ + (itclIntStubsPtr->itcl_Assert) /* 115 */ +#endif + +#endif /* defined(USE_ITCL_STUBS) && !defined(USE_ITCL_STUB_PROCS) */ + +/* !END!: Do not edit above this line. */ + +#endif /* _ITCLINTDECLS */ diff --git a/itcl/itcl/generic/itclStubInit.c b/itcl/itcl/generic/itclStubInit.c new file mode 100644 index 00000000000..50df340c26b --- /dev/null +++ b/itcl/itcl/generic/itclStubInit.c @@ -0,0 +1,185 @@ +/* + * itclStubInit.c -- + * + * This file contains the initializers for the Itcl stub vectors. + * + * Copyright (c) 1998-1999 by XXX + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: $Id$ + */ + +#include "itclInt.h" + +/* + * Remove macros that will interfere with the definitions below. + */ + + +/* + * WARNING: The contents of this file is automatically generated by the + * tools/genStubs.tcl script. Any modifications to the function declarations + * below should be made in the generic/tcl.decls script. + */ + +/* !BEGIN!: Do not edit below this line. */ + +ItclIntStubs itclIntStubs = { + TCL_STUB_MAGIC, + NULL, + Itcl_IsClassNamespace, /* 0 */ + Itcl_IsClass, /* 1 */ + Itcl_FindClass, /* 2 */ + Itcl_FindObject, /* 3 */ + Itcl_IsObject, /* 4 */ + Itcl_ObjectIsa, /* 5 */ + Itcl_Protection, /* 6 */ + Itcl_ProtectionStr, /* 7 */ + Itcl_CanAccess, /* 8 */ + Itcl_CanAccessFunc, /* 9 */ + Itcl_GetTrueNamespace, /* 10 */ + Itcl_ParseNamespPath, /* 11 */ + Itcl_DecodeScopedCommand, /* 12 */ + Itcl_EvalArgs, /* 13 */ + Itcl_CreateArgs, /* 14 */ + Itcl_PushContext, /* 15 */ + Itcl_PopContext, /* 16 */ + Itcl_GetContext, /* 17 */ + Itcl_InitHierIter, /* 18 */ + Itcl_DeleteHierIter, /* 19 */ + Itcl_AdvanceHierIter, /* 20 */ + Itcl_FindClassesCmd, /* 21 */ + Itcl_FindObjectsCmd, /* 22 */ + Itcl_ProtectionCmd, /* 23 */ + Itcl_DelClassCmd, /* 24 */ + Itcl_DelObjectCmd, /* 25 */ + Itcl_ScopeCmd, /* 26 */ + Itcl_CodeCmd, /* 27 */ + Itcl_StubCreateCmd, /* 28 */ + Itcl_StubExistsCmd, /* 29 */ + Itcl_IsStub, /* 30 */ + Itcl_CreateClass, /* 31 */ + Itcl_DeleteClass, /* 32 */ + Itcl_FindClassNamespace, /* 33 */ + Itcl_HandleClass, /* 34 */ + Itcl_ClassCmdResolver, /* 35 */ + Itcl_ClassVarResolver, /* 36 */ + Itcl_ClassCompiledVarResolver, /* 37 */ + Itcl_BuildVirtualTables, /* 38 */ + Itcl_CreateVarDefn, /* 39 */ + Itcl_DeleteVarDefn, /* 40 */ + Itcl_GetCommonVar, /* 41 */ + Itcl_CreateMember, /* 42 */ + Itcl_DeleteMember, /* 43 */ + Itcl_CreateObject, /* 44 */ + Itcl_DeleteObject, /* 45 */ + Itcl_DestructObject, /* 46 */ + Itcl_HandleInstance, /* 47 */ + Itcl_GetInstanceVar, /* 48 */ + Itcl_ScopedVarResolver, /* 49 */ + Itcl_BodyCmd, /* 50 */ + Itcl_ConfigBodyCmd, /* 51 */ + Itcl_CreateMethod, /* 52 */ + Itcl_CreateProc, /* 53 */ + Itcl_CreateMemberFunc, /* 54 */ + Itcl_ChangeMemberFunc, /* 55 */ + Itcl_DeleteMemberFunc, /* 56 */ + Itcl_CreateMemberCode, /* 57 */ + Itcl_DeleteMemberCode, /* 58 */ + Itcl_GetMemberCode, /* 59 */ + NULL, /* 60 */ + Itcl_EvalMemberCode, /* 61 */ + Itcl_CreateArgList, /* 62 */ + Itcl_CreateArg, /* 63 */ + Itcl_DeleteArgList, /* 64 */ + Itcl_ArgList, /* 65 */ + Itcl_EquivArgLists, /* 66 */ + Itcl_GetMemberFuncUsage, /* 67 */ + Itcl_ExecMethod, /* 68 */ + Itcl_ExecProc, /* 69 */ + Itcl_AssignArgs, /* 70 */ + Itcl_ConstructBase, /* 71 */ + Itcl_InvokeMethodIfExists, /* 72 */ + NULL, /* 73 */ + Itcl_ReportFuncErrors, /* 74 */ + Itcl_ParseInit, /* 75 */ + Itcl_ClassCmd, /* 76 */ + Itcl_ClassInheritCmd, /* 77 */ + Itcl_ClassProtectionCmd, /* 78 */ + Itcl_ClassConstructorCmd, /* 79 */ + Itcl_ClassDestructorCmd, /* 80 */ + Itcl_ClassMethodCmd, /* 81 */ + Itcl_ClassProcCmd, /* 82 */ + Itcl_ClassVariableCmd, /* 83 */ + Itcl_ClassCommonCmd, /* 84 */ + Itcl_ParseVarResolver, /* 85 */ + Itcl_BiInit, /* 86 */ + Itcl_InstallBiMethods, /* 87 */ + Itcl_BiIsaCmd, /* 88 */ + Itcl_BiConfigureCmd, /* 89 */ + Itcl_BiCgetCmd, /* 90 */ + Itcl_BiChainCmd, /* 91 */ + Itcl_BiInfoClassCmd, /* 92 */ + Itcl_BiInfoInheritCmd, /* 93 */ + Itcl_BiInfoHeritageCmd, /* 94 */ + Itcl_BiInfoFunctionCmd, /* 95 */ + Itcl_BiInfoVariableCmd, /* 96 */ + Itcl_BiInfoBodyCmd, /* 97 */ + Itcl_BiInfoArgsCmd, /* 98 */ + Itcl_DefaultInfoCmd, /* 99 */ + Itcl_EnsembleInit, /* 100 */ + Itcl_CreateEnsemble, /* 101 */ + Itcl_AddEnsemblePart, /* 102 */ + Itcl_GetEnsemblePart, /* 103 */ + Itcl_IsEnsemble, /* 104 */ + Itcl_GetEnsembleUsage, /* 105 */ + Itcl_GetEnsembleUsageForObj, /* 106 */ + Itcl_EnsembleCmd, /* 107 */ + Itcl_EnsPartCmd, /* 108 */ + Itcl_EnsembleErrorCmd, /* 109 */ + Itcl_OldInit, /* 110 */ + Itcl_InstallOldBiMethods, /* 111 */ + _Tcl_GetCallFrame, /* 112 */ + _Tcl_ActivateCallFrame, /* 113 */ + _TclNewVar, /* 114 */ + Itcl_Assert, /* 115 */ +}; + +static ItclStubHooks itclStubHooks = { + &itclIntStubs +}; + +ItclStubs itclStubs = { + TCL_STUB_MAGIC, + &itclStubHooks, + Itcl_Init, /* 0 */ + Itcl_SafeInit, /* 1 */ + Itcl_RegisterC, /* 2 */ + Itcl_RegisterObjC, /* 3 */ + Itcl_FindC, /* 4 */ + Itcl_InitStack, /* 5 */ + Itcl_DeleteStack, /* 6 */ + Itcl_PushStack, /* 7 */ + Itcl_PopStack, /* 8 */ + Itcl_PeekStack, /* 9 */ + Itcl_GetStackValue, /* 10 */ + Itcl_InitList, /* 11 */ + Itcl_DeleteList, /* 12 */ + Itcl_CreateListElem, /* 13 */ + Itcl_DeleteListElem, /* 14 */ + Itcl_InsertList, /* 15 */ + Itcl_InsertListElem, /* 16 */ + Itcl_AppendList, /* 17 */ + Itcl_AppendListElem, /* 18 */ + Itcl_SetListValue, /* 19 */ + Itcl_EventuallyFree, /* 20 */ + Itcl_PreserveData, /* 21 */ + Itcl_ReleaseData, /* 22 */ + Itcl_SaveInterpState, /* 23 */ + Itcl_RestoreInterpState, /* 24 */ + Itcl_DiscardInterpState, /* 25 */ +}; + +/* !END!: Do not edit above this line. */ diff --git a/itcl/itcl/generic/itclStubLib.c b/itcl/itcl/generic/itclStubLib.c new file mode 100644 index 00000000000..80fe17a2fe1 --- /dev/null +++ b/itcl/itcl/generic/itclStubLib.c @@ -0,0 +1,83 @@ +/* + * itclStubLib.c -- + * + * Stub object that will be statically linked into extensions that wish + * to access Itcl. + * + * Copyright (c) 1998-1999 by XXXX + * Copyright (c) 1998 Paul Duffin. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * RCS: $Id$ + */ + +/* + * We need to ensure that we use the stub macros so that this file contains + * no references to any of the stub functions. This will make it possible + * to build an extension that references Tcl_InitStubs but doesn't end up + * including the rest of the stub functions. + */ + +#ifndef USE_TCL_STUBS +#define USE_TCL_STUBS +#endif +#undef USE_TCL_STUB_PROCS + +/* + * This ensures that the Itcl_InitStubs has a prototype in + * itcl.h and is not the macro that turns it into Tcl_PkgRequire + */ + +#ifndef USE_ITCL_STUBS +#define USE_ITCL_STUBS +#endif + +#include "itclInt.h" + +ItclStubs *itclStubsPtr; +ItclIntStubs *itclIntStubsPtr; + +/* + *---------------------------------------------------------------------- + * + * Itcl_InitStubs -- + * + * Tries to initialise the stub table pointers and ensures that + * the correct version of Itcl is loaded. + * + * Results: + * The actual version of Itcl that satisfies the request, or + * NULL to indicate that an error occurred. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + +char * +Itcl_InitStubs (interp, version, exact) + Tcl_Interp *interp; + char *version; + int exact; +{ + char *actualVersion; + + actualVersion = Tcl_PkgRequireEx(interp, "Itcl", version, exact, + (ClientData *) &itclStubsPtr); + + if (actualVersion == NULL) { + itclStubsPtr = NULL; + return NULL; + } + + if (itclStubsPtr->hooks) { + itclIntStubsPtr = itclStubsPtr->hooks->itclIntStubs; + } else { + itclIntStubsPtr = NULL; + } + + return actualVersion; +} diff --git a/itcl/itcl/generic/itcl_bicmds.c b/itcl/itcl/generic/itcl_bicmds.c index d9319a4b4e9..0340dc8bc3d 100644 --- a/itcl/itcl/generic/itcl_bicmds.c +++ b/itcl/itcl/generic/itcl_bicmds.c @@ -841,6 +841,10 @@ Itcl_BiInfoClassCmd(dummy, interp, objc, objv) */ if (contextObj) { contextNs = contextObj->classDefn->namesp; + } else { + assert(contextClass != NULL); + assert(contextClass->namesp != NULL); + contextNs = contextClass->namesp; } if (contextNs->parentPtr == activeNs) { diff --git a/itcl/itcl/generic/itcl_class.c b/itcl/itcl/generic/itcl_class.c index 9ef772a55ee..5661ad3f784 100644 --- a/itcl/itcl/generic/itcl_class.c +++ b/itcl/itcl/generic/itcl_class.c @@ -1004,6 +1004,9 @@ Itcl_ClassVarResolver(interp, name, context, flags, rPtr) * in interp if anything goes wrong */ Tcl_Var *rPtr; /* returns: resolved variable */ { + Interp *iPtr = (Interp *) interp; + CallFrame *varFramePtr = iPtr->varFramePtr; + ItclClass *cdefn = (ItclClass*)context->clientData; ItclObject *contextObj; Tcl_CallFrame *framePtr; @@ -1021,6 +1024,57 @@ Itcl_ClassVarResolver(interp, name, context, flags, rPtr) } /* + * See if this is a formal parameter in the current proc scope. + * If so, that variable has precedence. Look it up and return + * it here. This duplicates some of the functionality of + * TclLookupVar, but we return it here (instead of returning + * TCL_CONTINUE) to avoid looking it up again later. + */ + if (varFramePtr && varFramePtr->isProcCallFrame + && strstr(name,"::") == NULL) { + + Proc *procPtr = varFramePtr->procPtr; + + /* + * Search through compiled locals first... + */ + if (procPtr) { + int localCt = procPtr->numCompiledLocals; + CompiledLocal *localPtr = procPtr->firstLocalPtr; + Var *localVarPtr = varFramePtr->compiledLocals; + int nameLen = strlen(name); + int i; + + for (i=0; i < localCt; i++) { + if (!TclIsVarTemporary(localPtr)) { + register char *localName = localVarPtr->name; + if ((name[0] == localName[0]) + && (nameLen == localPtr->nameLength) + && (strcmp(name, localName) == 0)) { + *rPtr = (Tcl_Var)localVarPtr; + return TCL_OK; + } + } + localVarPtr++; + localPtr = localPtr->nextPtr; + } + } + + /* + * If it's not a compiled local, then look in the frame's + * var hash table next. This variable may have been + * created on the fly. + */ + if (varFramePtr->varTablePtr != NULL) { + entry = Tcl_FindHashEntry(varFramePtr->varTablePtr, name); + if (entry != NULL) { + *rPtr = (Tcl_Var)Tcl_GetHashValue(entry); + return TCL_OK; + } + } + } + + /* * See if the variable is a known data member and accessible. */ entry = Tcl_FindHashEntry(&cdefn->resolveVars, name); diff --git a/itcl/itcl/generic/itcl_cmds.c b/itcl/itcl/generic/itcl_cmds.c index bd06331e936..773e3098af1 100644 --- a/itcl/itcl/generic/itcl_cmds.c +++ b/itcl/itcl/generic/itcl_cmds.c @@ -52,11 +52,39 @@ namespace eval ::itcl {\n\ variable library\n\ variable version\n\ rename _find_init {}\n\ - if {[catch {uplevel #0 source -rsrc itcl}] == 0} {\n\ - return\n\ + if {[info exists library]} {\n\ + lappend dirs $library\n\ + } else {\n\ + if {[catch {uplevel #0 source -rsrc itcl}] == 0} {\n\ + return\n\ + }\n\ + set dirs {}\n\ + if {[info exists env(ITCL_LIBRARY)]} {\n\ + lappend dirs $env(ITCL_LIBRARY)\n\ + }\n\ + lappend dirs [file join [file dirname $tcl_library] itcl$version]\n\ + set bindir [file dirname [info nameofexecutable]]\n\ + lappend dirs [file join $bindir .. lib itcl$version]\n\ + lappend dirs [file join $bindir .. library]\n\ + lappend dirs [file join $bindir .. .. library]\n\ + lappend dirs [file join $bindir .. .. itcl library]\n\ + lappend dirs [file join $bindir .. .. .. itcl library]\n\ }\n\ - tcl_findLibrary itcl 3.0 {} itcl.tcl ITCL_LIBRARY ::itcl::library {} {} itcl\n\ - }\n\ + foreach i $dirs {\n\ + set library $i\n\ + set itclfile [file join $i itcl.tcl]\n\ + if {![catch {uplevel #0 [list source $itclfile]} msg]} {\n\ + return\n\ + }\n\ + }\n\ + set msg \"Can't find a usable itcl.tcl in the following directories:\n\"\n\ + append msg \" $dirs\n\"\n\ + append msg \"This probably means that Itcl/Tcl weren't installed properly.\n\"\n\ + append msg \"If you know where the Itcl library directory was installed,\n\"\n\ + append msg \"you can set the environment variable ITCL_LIBRARY to point\n\"\n\ + append msg \"to the library directory.\n\"\n\ + error $msg\n\ + }\n\ _find_init\n\ }"; @@ -66,13 +94,15 @@ namespace eval ::itcl {\n\ static char safeInitScript[] = "proc ::itcl::local {class name args} {\n\ - set ptr [uplevel eval [list $class $name] $args]\n\ + set ptr [uplevel [list $class $name] $args]\n\ uplevel [list set itcl-local-$ptr $ptr]\n\ set cmd [uplevel namespace which -command $ptr]\n\ uplevel [list trace variable itcl-local-$ptr u \"::itcl::delete object $cmd; list\"]\n\ return $ptr\n\ }"; +extern ItclStubs itclStubs; + /* * ------------------------------------------------------------------------ @@ -97,9 +127,9 @@ Initialize(interp) Tcl_Namespace *itclNs; ItclObjectInfo *info; - if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1) == NULL) { + if (Tcl_InitStubs(interp, "8.1", 0) == NULL) { return TCL_ERROR; - } + }; /* * See if [incr Tcl] is already installed. @@ -276,7 +306,8 @@ Initialize(interp) /* * Package is now loaded. */ - if (Tcl_PkgProvide(interp, "Itcl", ITCL_VERSION) != TCL_OK) { + if (Tcl_PkgProvideEx(interp, "Itcl", ITCL_VERSION, + (ClientData) &itclStubs) != TCL_OK) { return TCL_ERROR; } return TCL_OK; @@ -385,11 +416,11 @@ ItclDelObjectInfo(cdata) * ------------------------------------------------------------------------ * Itcl_FindClassesCmd() * - * Part of the "::info" ensemble. Invoked by Tcl whenever the user - * issues an "info classes" command to query the list of classes - * in the current namespace. Handles the following syntax: + * Invoked by Tcl whenever the user issues an "itcl::find classes" + * command to query the list of known classes. Handles the following + * syntax: * - * info classes ?<pattern>? + * find classes ?<pattern>? * * Returns TCL_OK/TCL_ERROR to indicate success/failure. * ------------------------------------------------------------------------ @@ -408,11 +439,11 @@ Itcl_FindClassesCmd(clientData, interp, objc, objv) char *pattern; char *name; - int i, nsearch, newEntry; + int i, newEntry, handledActiveNs; Tcl_HashTable unique; Tcl_HashEntry *entry; Tcl_HashSearch place; - Tcl_Namespace *search[2]; + Itcl_Stack search; Tcl_Command cmd, originalCmd; Namespace *nsPtr; Tcl_Obj *listPtr, *objPtr; @@ -430,22 +461,25 @@ Itcl_FindClassesCmd(clientData, interp, objc, objv) } /* - * Search through all commands in the current namespace and - * in the global namespace. If we find any commands that + * Search through all commands in the current namespace first, + * in the global namespace next, then in all child namespaces + * in this interpreter. If we find any commands that * represent classes, report them. */ listPtr = Tcl_NewListObj(0, (Tcl_Obj* CONST*)NULL); - nsearch = 0; - search[nsearch++] = activeNs; - if (activeNs != globalNs) { - search[nsearch++] = globalNs; - } + Itcl_InitStack(&search); + Itcl_PushStack((ClientData)globalNs, &search); + Itcl_PushStack((ClientData)activeNs, &search); /* last in, first out! */ Tcl_InitHashTable(&unique, TCL_ONE_WORD_KEYS); - for (i=0; i < nsearch; i++) { - nsPtr = (Namespace*)search[i]; + handledActiveNs = 0; + while (Itcl_GetStackSize(&search) > 0) { + nsPtr = (Namespace*)Itcl_PopStack(&search); + if (nsPtr == (Namespace*)activeNs && handledActiveNs) { + continue; + } entry = Tcl_FirstHashEntry(&nsPtr->cmdTable, &place); while (entry) { @@ -485,8 +519,20 @@ Itcl_FindClassesCmd(clientData, interp, objc, objv) } entry = Tcl_NextHashEntry(&place); } + handledActiveNs = 1; /* don't process the active namespace twice */ + + /* + * Push any child namespaces onto the stack and continue + * the search in those namespaces. + */ + entry = Tcl_FirstHashEntry(&nsPtr->childTable, &place); + while (entry != NULL) { + Itcl_PushStack(Tcl_GetHashValue(entry), &search); + entry = Tcl_NextHashEntry(&place); + } } Tcl_DeleteHashTable(&unique); + Itcl_DeleteStack(&search); Tcl_SetObjResult(interp, listPtr); return TCL_OK; @@ -497,11 +543,11 @@ Itcl_FindClassesCmd(clientData, interp, objc, objv) * ------------------------------------------------------------------------ * Itcl_FindObjectsCmd() * - * Part of the "::info" ensemble. Invoked by Tcl whenever the user - * issues an "info objects" command to query the list of known objects. - * Handles the following syntax: + * Invoked by Tcl whenever the user issues an "itcl::find objects" + * command to query the list of known objects. Handles the following + * syntax: * - * info objects ?-class <className>? ?-isa <className>? ?<pattern>? + * find objects ?-class <className>? ?-isa <className>? ?<pattern>? * * Returns TCL_OK/TCL_ERROR to indicate success/failure. * ------------------------------------------------------------------------ @@ -522,12 +568,12 @@ Itcl_FindObjectsCmd(clientData, interp, objc, objv) ItclClass *isaDefn = NULL; char *name, *token; - int i, pos, nsearch, newEntry, match; + int i, pos, newEntry, match, handledActiveNs; ItclObject *contextObj; Tcl_HashTable unique; Tcl_HashEntry *entry; Tcl_HashSearch place; - Tcl_Namespace *search[2]; + Itcl_Stack search; Tcl_Command cmd, originalCmd; Namespace *nsPtr; Command *cmdPtr; @@ -564,6 +610,16 @@ Itcl_FindObjectsCmd(clientData, interp, objc, objv) } pos++; } + + /* + * Last token? Take it as the pattern, even if it starts + * with a "-". This allows us to match object names that + * start with "-". + */ + else if (pos == objc-1 && !pattern) { + pattern = token; + forceFullNames = (strstr(pattern, "::") != NULL); + } else { break; } @@ -576,22 +632,25 @@ Itcl_FindObjectsCmd(clientData, interp, objc, objv) } /* - * Search through all commands in the current namespace and - * in the global namespace. If we find any commands that + * Search through all commands in the current namespace first, + * in the global namespace next, then in all child namespaces + * in this interpreter. If we find any commands that * represent objects, report them. */ listPtr = Tcl_NewListObj(0, (Tcl_Obj* CONST*)NULL); - nsearch = 0; - search[nsearch++] = activeNs; - if (activeNs != globalNs) { - search[nsearch++] = globalNs; - } + Itcl_InitStack(&search); + Itcl_PushStack((ClientData)globalNs, &search); + Itcl_PushStack((ClientData)activeNs, &search); /* last in, first out! */ Tcl_InitHashTable(&unique, TCL_ONE_WORD_KEYS); - for (i=0; i < nsearch; i++) { - nsPtr = (Namespace*)search[i]; + handledActiveNs = 0; + while (Itcl_GetStackSize(&search) > 0) { + nsPtr = (Namespace*)Itcl_PopStack(&search); + if (nsPtr == (Namespace*)activeNs && handledActiveNs) { + continue; + } entry = Tcl_FirstHashEntry(&nsPtr->cmdTable, &place); while (entry) { @@ -653,8 +712,20 @@ Itcl_FindObjectsCmd(clientData, interp, objc, objv) } entry = Tcl_NextHashEntry(&place); } + handledActiveNs = 1; /* don't process the active namespace twice */ + + /* + * Push any child namespaces onto the stack and continue + * the search in those namespaces. + */ + entry = Tcl_FirstHashEntry(&nsPtr->childTable, &place); + while (entry != NULL) { + Itcl_PushStack(Tcl_GetHashValue(entry), &search); + entry = Tcl_NextHashEntry(&place); + } } Tcl_DeleteHashTable(&unique); + Itcl_DeleteStack(&search); Tcl_SetObjResult(interp, listPtr); return TCL_OK; @@ -702,10 +773,10 @@ Itcl_ProtectionCmd(clientData, interp, objc, objv) if (objc == 2) { /* CYGNUS LOCAL - Fix for 8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - result = Tcl_EvalObj(interp, objv[1]); -#else +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 result = Tcl_EvalObj(interp, objv[1], 0); +#else + result = Tcl_EvalObj(interp, objv[1]); #endif /* END CYGNUS LOCAL */ } else { diff --git a/itcl/itcl/generic/itcl_ensemble.c b/itcl/itcl/generic/itcl_ensemble.c index 60ba06ebab7..fb5f802ad7b 100644 --- a/itcl/itcl/generic/itcl_ensemble.c +++ b/itcl/itcl/generic/itcl_ensemble.c @@ -1690,19 +1690,19 @@ Itcl_EnsembleCmd(clientData, interp, objc, objv) if (objc == 3) { /* CYGNUS LOCAL - fix for Tcl8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - status = Tcl_EvalObj(ensInfo->parser, objv[2]); -#else +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 status = Tcl_EvalObj(ensInfo->parser, objv[2], 0); +#else + status = Tcl_EvalObj(ensInfo->parser, objv[2]); #endif } else if (objc > 3) { objPtr = Tcl_NewListObj(objc-2, objv+2); -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - status = Tcl_EvalObj(ensInfo->parser, objPtr); -#else - Tcl_IncrRefCount(objPtr); + Tcl_IncrRefCount(objPtr); /* stop Eval trashing it */ +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 status = Tcl_EvalObj(ensInfo->parser, objPtr, 0); +#else + status = Tcl_EvalObj(ensInfo->parser, objPtr); #endif /* END CYGNUS LOCAL */ Tcl_DecrRefCount(objPtr); /* we're done with the object */ @@ -2114,6 +2114,7 @@ DupEnsInvocInternalRep(srcPtr, copyPtr) if (prevArgObj) { objPtr = Tcl_DuplicateObj(prevArgObj); + Tcl_IncrRefCount(objPtr); copyPtr->internalRep.twoPtrValue.ptr2 = (VOID *) objPtr; } } @@ -2165,7 +2166,7 @@ SetEnsInvocFromAny(interp, objPtr) * keep the string around as if it were the command line * invocation. */ - argObj = Tcl_NewStringObj(name, -1); + argObj = Tcl_NewStringObj(name, length); /* * Free the old representation and install a new one. diff --git a/itcl/itcl/generic/itcl_methods.c b/itcl/itcl/generic/itcl_methods.c index 06e6e65e316..2ea41100a2b 100644 --- a/itcl/itcl/generic/itcl_methods.c +++ b/itcl/itcl/generic/itcl_methods.c @@ -33,29 +33,6 @@ #include "itclInt.h" #include "tclCompile.h" -/* CYGNUS LOCAL */ -/* FIXME - it looks like Michael removed the dependance on these... */ -#if 0 -#ifdef __CYGWIN32__ - -/* On cygwin32, this is how we import these variables from the Tcl DLL. */ - -extern int *_imp__tclTraceCompile; - -#define tclTraceCompile (*_imp__tclTraceCompile) - -extern int *_imp__tclTraceExec; - -#define tclTraceExec (*_imp__tclTraceExec) - -extern Tcl_ObjType *_imp__tclByteCodeType; - -#define tclByteCodeType (*_imp__tclByteCodeType) - -#endif -#endif -/* END CYGNUS LOCAL */ - /* * FORWARD DECLARATIONS */ @@ -1025,10 +1002,10 @@ Itcl_EvalMemberCode(interp, mfunc, member, contextObj, objc, objv) } else if ((mcode->flags & ITCL_IMPLEMENT_TCL) != 0) { /* CYGNUS LOCAL - Fix for Tcl8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - result = Tcl_EvalObj(interp, mcode->procPtr->bodyPtr); -#else +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 result = Tcl_EvalObj(interp, mcode->procPtr->bodyPtr, 0); +#else + result = Tcl_EvalObj(interp, mcode->procPtr->bodyPtr); #endif /* END CYGNUS LOCAL */ } @@ -2326,10 +2303,10 @@ Itcl_ConstructBase(interp, contextObj, contextClass) */ if (contextClass->initCode) { /* CYGNUS LOCAL - Fix for Tcl8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - if (Tcl_EvalObj(interp, contextClass->initCode) != TCL_OK) { +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 + if (Tcl_EvalObj(interp, contextClass->initCode, 0) != TCL_OK) { #else - if (Tcl_EvalObj(interp, contextClass->initCode, 0) != TCL_OK) { + if (Tcl_EvalObj(interp, contextClass->initCode) != TCL_OK) { #endif /* END CYGNUS LOCAL */ return TCL_ERROR; diff --git a/itcl/itcl/generic/itcl_objects.c b/itcl/itcl/generic/itcl_objects.c index fa1ab2ff21f..468c0bf71d2 100644 --- a/itcl/itcl/generic/itcl_objects.c +++ b/itcl/itcl/generic/itcl_objects.c @@ -98,9 +98,13 @@ Itcl_CreateObject(interp, name, cdefn, objc, objv, roPtr) /* * If installing an object access command will clobber another - * command, signal an error. + * command, signal an error. Be careful to look for the object + * only in the current namespace context. Otherwise, we might + * find a global command, but that wouldn't be clobbered! */ - cmd = Tcl_FindCommand(interp, name, (Tcl_Namespace*)NULL, /* flags */ 0); + cmd = Tcl_FindCommand(interp, name, (Tcl_Namespace*)NULL, + TCL_NAMESPACE_ONLY); + if (cmd != NULL && !Itcl_IsStub(cmd)) { Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "command \"", name, "\" already exists in namespace \"", @@ -233,10 +237,10 @@ Itcl_CreateObject(interp, name, cdefn, objc, objv, roPtr) */ if (result != TCL_OK) { istate = Itcl_SaveInterpState(interp, result); - if (newObj->accessCmd != NULL) { - Tcl_DeleteCommandFromToken(interp, newObj->accessCmd); - newObj->accessCmd = NULL; - } + + Tcl_DeleteCommandFromToken(interp, newObj->accessCmd); + newObj->accessCmd = NULL; + result = Itcl_RestoreInterpState(interp, istate); } diff --git a/itcl/itcl/generic/itcl_obsolete.c b/itcl/itcl/generic/itcl_obsolete.c index 37c9336885d..6d7b2dcf1e9 100644 --- a/itcl/itcl/generic/itcl_obsolete.c +++ b/itcl/itcl/generic/itcl_obsolete.c @@ -480,10 +480,10 @@ ItclOldClassCmd(clientData, interp, objc, objv) if (result == TCL_OK) { /* CYGNUS LOCAL - Fix for Tcl8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - result = Tcl_EvalObj(interp, objv[2]); -#else +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 result = Tcl_EvalObj(interp, objv[2], 0); +#else + result = Tcl_EvalObj(interp, objv[2]); #endif /* END CYGNUS LOCAL */ Tcl_PopCallFrame(interp); diff --git a/itcl/itcl/generic/itcl_parse.c b/itcl/itcl/generic/itcl_parse.c index dac966f4e01..23d4510bc14 100644 --- a/itcl/itcl/generic/itcl_parse.c +++ b/itcl/itcl/generic/itcl_parse.c @@ -256,10 +256,10 @@ Itcl_ClassCmd(clientData, interp, objc, objv) if (result == TCL_OK) { /* CYGNUS LOCAL - Fix for Tcl8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - result = Tcl_EvalObj(interp, objv[2]); -#else +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 result = Tcl_EvalObj(interp, objv[2], 0); +#else + result = Tcl_EvalObj(interp, objv[2]); #endif /* END CYGNUS LOCAL */ Tcl_PopCallFrame(interp); @@ -581,10 +581,10 @@ Itcl_ClassProtectionCmd(clientData, interp, objc, objv) if (objc == 2) { /* CYGNUS LOCAL - Fix for Tcl8.1 */ -#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 - result = Tcl_EvalObj(interp, objv[1]); -#else +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 1 result = Tcl_EvalObj(interp, objv[1], 0); +#else + result = Tcl_EvalObj(interp, objv[1]); #endif /* END CYGNUS LOCAL */ } else { @@ -1067,6 +1067,8 @@ Itcl_ParseVarResolver(interp, name, contextNs, flags, rPtr) */ return TCL_CONTINUE; } + + /* * ------------------------------------------------------------------------ diff --git a/itcl/itcl/generic/itcl_util.c b/itcl/itcl/generic/itcl_util.c index e33823ba877..e6eed63217b 100644 --- a/itcl/itcl/generic/itcl_util.c +++ b/itcl/itcl/generic/itcl_util.c @@ -80,7 +80,6 @@ typedef struct InterpState { * message and abruptly exits. * ------------------------------------------------------------------------ */ -#ifndef NDEBUG void Itcl_Assert(testExpr, fileName, lineNumber) @@ -88,12 +87,13 @@ Itcl_Assert(testExpr, fileName, lineNumber) char *fileName; /* file name containing this call */ int lineNumber; /* line number containing this call */ { +#ifndef NDEBUG fprintf(stderr, "Assertion failed: \"%s\" (line %d of %s)", testExpr, lineNumber, fileName); abort(); +#endif } -#endif /* diff --git a/itcl/itcl/itclConfig.sh.in b/itcl/itcl/itclConfig.sh.in index 82bebb1be31..2e094a1875b 100644 --- a/itcl/itcl/itclConfig.sh.in +++ b/itcl/itcl/itclConfig.sh.in @@ -28,6 +28,23 @@ ITCL_BUILD_LIB_SPEC='@ITCL_BUILD_LIB_SPEC@' # installed directory. ITCL_LIB_SPEC='@ITCL_LIB_SPEC@' +# Full path to itcl library for dependency checking. +ITCL_LIB_FULL_PATH='@ITCL_LIB_FULL_PATH@' + +# The name of the Itcl stub library +ITCL_STUB_LIB_FILE=@ITCL_STUB_LIB_FILE@ + +# String to pass to linker to pick up the Itcl stub library from its +# build directory. +ITCL_BUILD_STUB_LIB_SPEC='@ITCL_BUILD_STUB_LIB_SPEC@' + +# String to pass to linker to pick up the Itcl stub library from its +# installed directory. +ITCL_STUB_LIB_SPEC='@ITCL_STUB_LIB_SPEC@' + +# Full path to itcl library for dependency checking. +ITCL_STUB_LIB_FULL_PATH='@ITCL_STUB_LIB_FULL_PATH@' + # Location of the top-level source directories from which [incr Tcl] # was built. This is the directory that contains generic, unix, etc. # If [incr Tcl] was compiled in a different place than the directory @@ -37,6 +54,3 @@ ITCL_SRC_DIR='@ITCL_SRC_DIR@' # Name and location of the incr tcl shell. Used during the build process. ITCL_SH='@ITCL_SH@' - -# Full path to itcl library for dependency checking. -ITCL_LIB_FULL_PATH='@ITCL_LIB_FULL_PATH@'
\ No newline at end of file diff --git a/itcl/itcl/library/itcl.tcl b/itcl/itcl/library/itcl.tcl index cb3ad949b2a..3a8e54c3b22 100644 --- a/itcl/itcl/library/itcl.tcl +++ b/itcl/itcl/library/itcl.tcl @@ -27,7 +27,7 @@ # alive until a procedure exits. # ---------------------------------------------------------------------- proc ::itcl::local {class name args} { - set ptr [uplevel eval [list $class $name] $args] + set ptr [uplevel [list $class $name] $args] uplevel [list set itcl-local-$ptr $ptr] set cmd [uplevel namespace which -command $ptr] uplevel [list trace variable itcl-local-$ptr u \ diff --git a/itcl/itcl/mac/MW_ItclHeader.pch b/itcl/itcl/mac/MW_ItclHeader.pch new file mode 100644 index 00000000000..53781d10643 --- /dev/null +++ b/itcl/itcl/mac/MW_ItclHeader.pch @@ -0,0 +1,74 @@ +/* + * MW_TclHeader.pch -- + * + * This file is the source for a pre-compilied header that gets used + * for all files in the Tcl projects. This make compilies go a bit + * faster. This file is only intended to be used in the MetroWerks + * CodeWarrior environment. It essentially acts as a place to set + * compiler flags. See MetroWerks documention for more details. + * + * Copyright (c) 1995-1997 Sun Microsystems, Inc. + * + * See the file "license.terms" for information on usage and redistribution + * of this file, and for a DISCLAIMER OF ALL WARRANTIES. + * + * SCCS: @(#) MW_TclHeader.pch 1.27 97/11/20 18:45:25 + */ + +/* + * To use the compilied header you need to set the "Prefix file" in + * the "C/C++ Language" preference panel to point to the created + * compilied header. The name of the header depends on the + * architecture we are compiling for (see the code below). For + * example, for a 68k app the prefix file should be: MW_TclHeader68K. + */ +#if __POWERPC__ +#pragma precompile_target "MW_ItclHeaderPPC" +#include "MW_TclHeaderPPC" +#elif __CFM68K__ +#pragma precompile_target "MW_ItclHeaderCFM68K" +#include "MW_TclHeaderCFM68K" +#else +#pragma precompile_target "MW_ItclHeader68K" +#include "MW_TclHeader68K" +#endif + +/* + * Macintosh Tcl must be compiled with certain compiler options to + * ensure that it will work correctly. The following pragmas are + * used to ensure that those options are set correctly. An error + * will occur at compile time if they are not set correctly. + */ + +#if !__option(enumsalwaysint) +#error Tcl requires the Metrowerks setting "Enums always ints". +#endif + +#if !defined(__POWERPC__) +#if !__option(far_data) +#error Tcl requires the Metrowerks setting "Far data". +#endif +#endif + +#if !defined(__POWERPC__) +#if !__option(fourbyteints) +#error Tcl requires the Metrowerks setting "4 byte ints". +#endif +#endif + +#if !defined(__POWERPC__) +#if !__option(IEEEdoubles) +#error Tcl requires the Metrowerks setting "8 byte doubles". +#endif +#endif + +/* + * Place any includes below that will are needed by the majority of the + * and is OK to be in any file in the system. The pragma's are used + * to control what functions are exported in the Tcl shared library. + */ + +#pragma export on +#include "itcl.h" +#pragma export reset + diff --git a/itcl/itcl/mac/itclMacLibrary.r b/itcl/itcl/mac/itclMacLibrary.r index 44b38d2cb54..d9076d44021 100644 --- a/itcl/itcl/mac/itclMacLibrary.r +++ b/itcl/itcl/mac/itclMacLibrary.r @@ -148,7 +148,7 @@ resource 'STR ' (-16397, purgeable) { data 'TEXT' (ITCL_LIBRARY_RESOURCES+1,"pkgIndex",purgeable, preload) { "# Tcl package index file, version 1.0\n" - "package ifneeded Itcl 3.0 [list load [file join $dir itcl30[info sharedlibextension]] Itcl]\n" + "package ifneeded Itcl 3.1 [list load [file join $dir itcl31[info sharedlibextension]] Itcl]\n" }; diff --git a/itcl/itcl/mac/pkgIndex.tcl b/itcl/itcl/mac/pkgIndex.tcl index 921b9b4f8fb..97a59dba370 100644 --- a/itcl/itcl/mac/pkgIndex.tcl +++ b/itcl/itcl/mac/pkgIndex.tcl @@ -1,3 +1,3 @@ # Tcl package index file, version 1.0 -package ifneeded Itcl 3.0 [list load [file join $dir itcl30[info sharedlibextension]] Itcl] +package ifneeded Itcl 3.1 [list load [file join $dir itcl31[info sharedlibextension]] Itcl] diff --git a/itcl/itcl/pkgIndex.tcl b/itcl/itcl/pkgIndex.tcl new file mode 100644 index 00000000000..14a29f45a0e --- /dev/null +++ b/itcl/itcl/pkgIndex.tcl @@ -0,0 +1,3 @@ +# Tcl package index file, version 1.0 + +package ifneeded Itcl 3.2 [list load [file join $dir .. "libitcl3.2.so"] Itcl] diff --git a/itcl/itcl/pkgIndex.tcl.in b/itcl/itcl/pkgIndex.tcl.in new file mode 100644 index 00000000000..da688ab54a8 --- /dev/null +++ b/itcl/itcl/pkgIndex.tcl.in @@ -0,0 +1,3 @@ +# Tcl package index file, version 1.0 + +package ifneeded Itcl @VERSION@ [list load [file join $dir @RELPATH@ "@itcl_LIB_FILE@"] Itcl] diff --git a/itcl/itcl/tests/all b/itcl/itcl/tests/all index b50794c1448..b8b15b09f16 100644 --- a/itcl/itcl/tests/all +++ b/itcl/itcl/tests/all @@ -3,6 +3,11 @@ # in this directory. # # SCCS: @(#) all 1.7 96/02/16 08:55:38 +# ------------------------------------------------------------------ +# THIS SCRIPT IS NOW DEPRECATED! It is kept for older Tcl +# installations that don't have the "tcltest" package. +# Instead, use the "all.tcl" script to run the test suite. +# ------------------------------------------------------------------ foreach i [lsort [glob *.test]] { if [string match l.*.test $i] { diff --git a/itcl/itcl/tests/all.tcl b/itcl/itcl/tests/all.tcl new file mode 100644 index 00000000000..ddefa468dd7 --- /dev/null +++ b/itcl/itcl/tests/all.tcl @@ -0,0 +1,122 @@ +# all.tcl -- +# +# This file contains a top-level script to run all of the Tcl +# tests. Execute it by invoking "source all.test" when running tcltest +# in this directory. +# +# Copyright (c) 1998-2000 by Ajuba Solutions +# All rights reserved. +# +# RCS: @(#) $Id$ + +package require tcltest +namespace import -force ::tcltest::* + +# Look for the -exedir flag and find a suitable tclsh executable. + +if {(![info exists argv]) || ([llength $argv] < 1)} { + set flagArray {} +} else { + set flagArray $argv +} + +array set flag $flagArray +if {[info exists flag(-exedir)]} { + set shell [lindex \ + [glob -nocomplain \ + [file join $flag(-exedir) tclsh*.bin] \ + [file join $flag(-exedir) tclsh*]] 0] +} else { + set shell $::tcltest::tcltest +} + +set ::tcltest::testSingleFile false + +# use [pwd] trick to expand relative file paths to absolute paths - MMc +set cwd [pwd] +cd [file dirname [info script]] +set ::tcltest::testsDirectory [pwd] +cd $cwd + +set logfile [file join $::tcltest::temporaryDirectory Log.txt] + +puts stdout "Using interp: $shell" +puts stdout "Running tests in working dir: $::tcltest::testsDirectory" +if {[llength $::tcltest::skip] > 0} { + puts stdout "Skipping tests that match: $::tcltest::skip" +} +if {[llength $::tcltest::match] > 0} { + puts stdout "Only running tests that match: $::tcltest::match" +} + +if {[llength $::tcltest::skipFiles] > 0} { + puts stdout "Skipping test files that match: $::tcltest::skipFiles" +} +if {[llength $::tcltest::matchFiles] > 0} { + puts stdout "Only sourcing test files that match: $::tcltest::matchFiles" +} + +set timeCmd {clock format [clock seconds]} +puts stdout "Tests began at [eval $timeCmd]" + +# source each of the specified tests +foreach file [lsort [::tcltest::getMatchingFiles]] { + set tail [file tail $file] + puts stdout $tail + + # Change to the tests directory so the value of the following + # variable is set correctly when we spawn the child test processes + + cd $::tcltest::testsDirectory + set cmd [concat [list | $shell $file] [split $argv] \ + [list -outfile $logfile]] + if {[catch { + set pipeFd [open $cmd "r"] + while {[gets $pipeFd line] >= 0} { + puts $::tcltest::outputChannel $line + } + close $pipeFd + } msg]} { + # Print results to ::tcltest::outputChannel. + puts $::tcltest::outputChannel $msg + } + + # Now concatenate the temporary log file to + # ::tcltest::outputChannel + if {[catch { + set fd [open $logfile "r"] + while {![eof $fd]} { + gets $fd line + if {![eof $fd]} { + if {[regexp {^([^:]+):\tTotal\t([0-9]+)\tPassed\t([0-9]+)\tSkipped\t([0-9]+)\tFailed\t([0-9]+)} $line null testFile Total Passed Skipped Failed]} { + foreach index [list "Total" "Passed" "Skipped" \ + "Failed"] { + incr ::tcltest::numTests($index) [set $index] + } + incr ::tcltest::numTestFiles + if {$Failed > 0} { + lappend ::tcltest::failFiles $testFile + } + } + puts $::tcltest::outputChannel $line + } + } + close $fd + } msg]} { + puts $::tcltest::outputChannel $msg + } +} + +set numFailures [llength $::tcltest::failFiles] + +# cleanup +puts stdout "\nTests ended at [eval $timeCmd]" +::tcltest::cleanupTests 1 + +if {$numFailures > 0} { + return -code error -errorcode $numFailures \ + -errorinfo "Found $numFailures test file failures" +} else { + return +} +exit diff --git a/itcl/itcl/tests/basic.test b/itcl/itcl/tests/basic.test index 5aba6bb2560..c60054644f6 100644 --- a/itcl/itcl/tests/basic.test +++ b/itcl/itcl/tests/basic.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Simple class definition # ---------------------------------------------------------------------- @@ -41,7 +46,7 @@ test basic-1.1 {define a simple class} { } "" test basic-1.2 {class is now defined} { - find classes Counter + itcl::find classes Counter } {Counter} test basic-1.3 {access command exists with class name} { @@ -65,15 +70,15 @@ test basic-1.6 {objects have an access command} { } {::x} test basic-1.7a {objects are added to the master list} { - find objects x + itcl::find objects x } {x} test basic-1.7b {objects are added to the master list} { - find objects -class Counter x + itcl::find objects -class Counter x } {x} test basic-1.8 {objects can be deleted} { - list [delete object x] [namespace which -command x] + list [itcl::delete object x] [namespace which -command x] } {{} {}} test basic-1.9 {objects can be recreated with the same name} { @@ -82,9 +87,14 @@ test basic-1.9 {objects can be recreated with the same name} { test basic-1.10 {objects can be destroyed by deleting their access command} { rename ::x "" - find objects x + itcl::find objects x } {} +test basic-1.11 {find command supports object names starting with -} { + Counter -foo + itcl::find objects -class Counter -foo +} {-foo} + # ---------------------------------------------------------------------- # #auto names # ---------------------------------------------------------------------- @@ -139,7 +149,7 @@ test basic-3.6 {configure actually changes public variable} { test basic-3.7 {class procs can be accessed} { Counter::num -} {6} +} {7} test basic-3.8 {obsolete syntax is no longer allowed} { list [catch "Counter :: num" msg] $msg @@ -152,8 +162,8 @@ Instead, remove the spaces from your procedure invocations: # Classes can be destroyed and redefined # ---------------------------------------------------------------------- test basic-4.1 {classes can be destroyed} { - list [delete class Counter] \ - [find classes Counter] \ + list [itcl::delete class Counter] \ + [itcl::find classes Counter] \ [namespace children :: Counter] \ [namespace which -command Counter] } {{} {} {} {}} @@ -177,9 +187,9 @@ test basic-4.4 {objects can be created from the new class} { } {counter0 counter1} test basic-4.5 {when a class is destroyed, its objects are deleted} { - list [lsort [find objects counter*]] \ - [delete class Counter] \ - [lsort [find objects counter*]] + list [lsort [itcl::find objects counter*]] \ + [itcl::delete class Counter] \ + [lsort [itcl::find objects counter*]] } {{counter0 counter1} {} {}} # ---------------------------------------------------------------------- @@ -317,3 +327,6 @@ test basic-6.7 {common variables can be unset} { test basic-6.8 {common variables can be redefined} { test_arrays0 do set undefined "scalar" } {scalar} + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/body.test b/itcl/itcl/tests/body.test index fbd4e65e21a..079a69cf94b 100644 --- a/itcl/itcl/tests/body.test +++ b/itcl/itcl/tests/body.test @@ -13,13 +13,18 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Test "body" command # ---------------------------------------------------------------------- test body-1.1 {define a class with missing bodies and arg lists} { - class test_body { + itcl::class test_body { constructor {args} {} destructor {} @@ -42,42 +47,42 @@ test body-1.2 {cannot use methods without a body} { } {1 {member function "::test_body::any" is not defined and cannot be autoloaded}} test body-1.3 {check syntax of "body" command} { - list [catch "body test_body::any" msg] $msg -} {1 {wrong # args: should be "body class::func arglist body"}} + list [catch "itcl::body test_body::any" msg] $msg +} {1 {wrong # args: should be "itcl::body class::func arglist body"}} test body-1.4 {make sure members are found correctly} { - list [catch "body test_body::xyzzyxyzzyxyzzy {} {}" msg] $msg + list [catch "itcl::body test_body::xyzzyxyzzyxyzzy {} {}" msg] $msg } {1 {function "xyzzyxyzzyxyzzy" is not defined in class "::test_body"}} test body-1.5a {members without an argument list can have any args} { - body test_body::any {} {return "any"} + itcl::body test_body::any {} {return "any"} list [catch "test_body0 any" msg] $msg } {0 any} test body-1.5b {members without an argument list can have any args} { - body test_body::any {x} {return "any: $x"} + itcl::body test_body::any {x} {return "any: $x"} list [catch "test_body0 any 1" msg] $msg } {0 {any: 1}} test body-1.5c {members without an argument list can have any args} { - body test_body::any {x {y 2}} {return "any: $x $y"} + itcl::body test_body::any {x {y 2}} {return "any: $x $y"} list [catch "test_body0 any 1" msg] $msg } {0 {any: 1 2}} test body-1.6a {an empty argument list must stay empty} { - list [catch {body test_body::zero {x y} {return "zero: $x $y"}} msg] $msg + list [catch {itcl::body test_body::zero {x y} {return "zero: $x $y"}} msg] $msg } {1 {argument list changed for function "::test_body::zero": should be ""}} test body-1.6b {an empty argument list must stay empty} { - list [catch {body test_body::zero {} {return "zero"}} msg] $msg + list [catch {itcl::body test_body::zero {} {return "zero"}} msg] $msg } {0 {}} test body-1.7a {preserve argument list: fixed arguments} { - list [catch {body test_body::one {x y} {return "one: $x $y"}} msg] $msg + list [catch {itcl::body test_body::one {x y} {return "one: $x $y"}} msg] $msg } {1 {argument list changed for function "::test_body::one": should be "x"}} test body-1.7b {preserve argument list: fixed arguments} { - list [catch {body test_body::one {a} {return "one: $a"}} msg] $msg + list [catch {itcl::body test_body::one {a} {return "one: $a"}} msg] $msg } {0 {}} test body-1.7c {preserve argument list: fixed arguments} { @@ -85,11 +90,11 @@ test body-1.7c {preserve argument list: fixed arguments} { } {0 {one: 1.0}} test body-1.8a {preserve argument list: fixed arguments} { - list [catch {body test_body::two {x} {return "two: $x"}} msg] $msg + list [catch {itcl::body test_body::two {x} {return "two: $x"}} msg] $msg } {1 {argument list changed for function "::test_body::two": should be "x y"}} test body-1.8b {preserve argument list: fixed arguments} { - list [catch {body test_body::two {a b} {return "two: $a $b"}} msg] $msg + list [catch {itcl::body test_body::two {a b} {return "two: $a $b"}} msg] $msg } {0 {}} test body-1.8c {preserve argument list: fixed arguments} { @@ -97,32 +102,32 @@ test body-1.8c {preserve argument list: fixed arguments} { } {0 {two: 2.0 3.0}} test body-1.9a {preserve argument list: default arguments} { - list [catch {body test_body::defvals {x} {}} msg] $msg + list [catch {itcl::body test_body::defvals {x} {}} msg] $msg } {1 {argument list changed for function "::test_body::defvals": should be "x {y 0} {z 1}"}} test body-1.9b {preserve argument list: default arguments} { - list [catch {body test_body::defvals {a {b 0} {c 2}} {}} msg] $msg + list [catch {itcl::body test_body::defvals {a {b 0} {c 2}} {}} msg] $msg } {1 {argument list changed for function "::test_body::defvals": should be "x {y 0} {z 1}"}} test body-1.9c {preserve argument list: default arguments} { - list [catch {body test_body::defvals {a {b 0} {c 1}} {}} msg] $msg + list [catch {itcl::body test_body::defvals {a {b 0} {c 1}} {}} msg] $msg } {0 {}} test body-1.10a {preserve argument list: variable arguments} { - list [catch {body test_body::varargs {} {}} msg] $msg + list [catch {itcl::body test_body::varargs {} {}} msg] $msg } {1 {argument list changed for function "::test_body::varargs": should be "x args"}} test body-1.10b {preserve argument list: variable arguments} { - list [catch {body test_body::varargs {a} {}} msg] $msg + list [catch {itcl::body test_body::varargs {a} {}} msg] $msg } {0 {}} test body-1.10c {preserve argument list: variable arguments} { - list [catch {body test_body::varargs {a b c} {}} msg] $msg + list [catch {itcl::body test_body::varargs {a b c} {}} msg] $msg } {0 {}} test body-1.11 {redefined body really does change} { list [test_body0 override "test #1"] \ - [body test_body::override {text} {return "new: $text"}] \ + [itcl::body test_body::override {text} {return "new: $text"}] \ [test_body0 override "test #2"] } {{override: test #1} {} {new: test #2}} @@ -130,7 +135,7 @@ test body-1.11 {redefined body really does change} { # Test "body" command with inheritance # ---------------------------------------------------------------------- test body-2.1 {inherit from a class with missing bodies} { - class test_ibody { + itcl::class test_ibody { inherit test_body method zero {} } @@ -138,20 +143,20 @@ test body-2.1 {inherit from a class with missing bodies} { } {test_ibody0} test body-2.2 {redefine a method in a derived class} { - body test_ibody::zero {} {return "ibody zero"} + itcl::body test_ibody::zero {} {return "ibody zero"} list [test_ibody0 info function zero] \ [test_ibody0 info function test_body::zero] } {{public method ::test_ibody::zero {} {return "ibody zero"}} {public method ::test_body::zero {} {return "zero"}}} test body-2.3 {try to redefine a method that was not declared} { - list [catch {body test_ibody::one {x} {return "new"}} msg] $msg + list [catch {itcl::body test_ibody::one {x} {return "new"}} msg] $msg } {1 {function "one" is not defined in class "::test_ibody"}} # ---------------------------------------------------------------------- # Test "configbody" command # ---------------------------------------------------------------------- test body-3.1 {define a class with public variables} { - class test_cbody { + itcl::class test_cbody { private variable priv protected variable prot @@ -164,19 +169,19 @@ test body-3.1 {define a class with public variables} { } "" test body-3.2 {check syntax of "configbody" command} { - list [catch "configbody test_cbody::option" msg] $msg -} {1 {wrong # args: should be "configbody class::option body"}} + list [catch "itcl::configbody test_cbody::option" msg] $msg +} {1 {wrong # args: should be "itcl::configbody class::option body"}} test body-3.3 {make sure that members are found correctly} { - list [catch "configbody test_cbody::xyzzy {}" msg] $msg + list [catch "itcl::configbody test_cbody::xyzzy {}" msg] $msg } {1 {option "xyzzy" is not defined in class "::test_cbody"}} test body-3.4 {private variables have no config code} { - list [catch "configbody test_cbody::priv {bogus}" msg] $msg + list [catch "itcl::configbody test_cbody::priv {bogus}" msg] $msg } {1 {option "::test_cbody::priv" is not a public configuration option}} test body-3.5 {protected variables have no config code} { - list [catch "configbody test_cbody::prot {bogus}" msg] $msg + list [catch "itcl::configbody test_cbody::prot {bogus}" msg] $msg } {1 {option "::test_cbody::prot" is not a public configuration option}} test body-3.6 {can use public variables without a body} { @@ -186,7 +191,7 @@ test body-3.6 {can use public variables without a body} { test body-3.7 {redefined body really does change} { list [test_cbody0 configure -option "hello"] \ - [configbody test_cbody::option {lappend messages "new: $option"}] \ + [itcl::configbody test_cbody::option {lappend messages "new: $option"}] \ [test_cbody0 configure -option "goodbye"] \ [set test_cbody::messages] \ } {{} {} {} {{option: hello} {new: goodbye}}} @@ -195,7 +200,7 @@ test body-3.7 {redefined body really does change} { # Test "configbody" command with inheritance # ---------------------------------------------------------------------- test body-4.1 {inherit from a class with missing config bodies} { - class test_icbody { + itcl::class test_icbody { inherit test_cbody public variable option "icbody" } @@ -203,16 +208,19 @@ test body-4.1 {inherit from a class with missing config bodies} { } {test_icbody0} test body-4.2 {redefine a body in a derived class} { - configbody test_icbody::option {lappend messages "test_icbody: $option"} + itcl::configbody test_icbody::option {lappend messages "test_icbody: $option"} list [test_icbody0 info variable option] \ [test_icbody0 info variable test_cbody::option] } {{public variable ::test_icbody::option icbody {lappend messages "test_icbody: $option"} icbody} {public variable ::test_cbody::option {} {lappend messages "new: $option"} {}}} test body-4.3 {try to redefine a body for a variable that was not declared} { - list [catch {configbody test_icbody::nocode {return "new"}} msg] $msg + list [catch {itcl::configbody test_icbody::nocode {return "new"}} msg] $msg } {1 {option "nocode" is not defined in class "::test_icbody"}} # ---------------------------------------------------------------------- # Clean up # ---------------------------------------------------------------------- -delete class test_body test_cbody +itcl::delete class test_body test_cbody + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/chain.test b/itcl/itcl/tests/chain.test index c78d5f34792..12cd2660447 100644 --- a/itcl/itcl/tests/chain.test +++ b/itcl/itcl/tests/chain.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Chaining methods and procs # ---------------------------------------------------------------------- @@ -145,4 +150,7 @@ test chain-3.0 {invoke "chain" outside of a class} { # ---------------------------------------------------------------------- # Clean up # ---------------------------------------------------------------------- -delete class test_chain_d test_chain_c test_chain_b test_chain_a +itcl::delete class test_chain_d test_chain_c test_chain_b test_chain_a + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/defs b/itcl/itcl/tests/defs index 4be66bc07c2..68a3779c051 100644 --- a/itcl/itcl/tests/defs +++ b/itcl/itcl/tests/defs @@ -10,6 +10,11 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # SCCS: @(#) defs 1.44 96/10/08 17:26:58 +# ------------------------------------------------------------------ +# THIS SCRIPT IS NOW DEPRECATED! It is kept for older Tcl +# installations that don't have the "tcltest" package. +# Instead, use "package require tcltest" in the test suite. +# ------------------------------------------------------------------ if ![info exists VERBOSE] { set VERBOSE 0 @@ -81,6 +86,9 @@ if {[info commands memory] == ""} { # 'echo' etc available. catch {unset testConfig} + +package require Itcl + if {$tcl_platform(platform) == "unix"} { set testConfig(unixOnly) 1 set testConfig(tempNotPc) 1 diff --git a/itcl/itcl/tests/delete.test b/itcl/itcl/tests/delete.test index bf4ce5b61b8..dc320824643 100644 --- a/itcl/itcl/tests/delete.test +++ b/itcl/itcl/tests/delete.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Deleting classes and objects # ---------------------------------------------------------------------- @@ -31,15 +36,15 @@ test delete-1.2 {create some base class objects} { for {set i 0} {$i < 5} {incr i} { test_delete_base #auto } - lsort [find objects -class test_delete_base] + lsort [itcl::find objects -class test_delete_base] } {test_delete_base0 test_delete_base1 test_delete_base2 test_delete_base3 test_delete_base4} test delete-1.3 {delete the base class--class and all objects go away} { - list [delete class test_delete_base] \ - [find classes test_delete_base] \ + list [itcl::delete class test_delete_base] \ + [itcl::find classes test_delete_base] \ [namespace children :: test_delete_base] \ [namespace which -command test_delete_base] \ - [find objects test_delete_base*] + [itcl::find objects test_delete_base*] } {{} {} {} {} {}} # ---------------------------------------------------------------------- @@ -72,16 +77,16 @@ test delete-2.2 {create some base and derived class objects} { for {set i 0} {$i < 3} {incr i} { test_delete #auto } - lsort [find objects -isa test_delete_base] + lsort [itcl::find objects -isa test_delete_base] } {test_delete0 test_delete1 test_delete2 test_delete_base0 test_delete_base1 test_delete_base2} test delete-2.3 {delete the base class--class and all objects go away} { - list [delete class test_delete_base] \ - [find classes test_delete*] \ + list [itcl::delete class test_delete_base] \ + [itcl::find classes test_delete*] \ [namespace children :: test_delete*] \ [namespace which -command test_delete_base] \ [namespace which -command test_delete] \ - [find objects test_delete*] + [itcl::find objects test_delete*] } {{} {} {} {} {} {}} test delete-2.4 {object destructors get invoked properly} { @@ -118,16 +123,16 @@ test delete-3.2 {create some base and derived class objects} { for {set i 0} {$i < 3} {incr i} { test_delete #auto } - lsort [find objects -isa test_delete_base] + lsort [itcl::find objects -isa test_delete_base] } {test_delete0 test_delete1 test_delete2 test_delete_base0 test_delete_base1 test_delete_base2} test delete-3.3 {deleting a class namespace is like deleting a class} { list [namespace delete test_delete_base] \ - [find classes test_delete*] \ + [itcl::find classes test_delete*] \ [namespace children :: test_delete*] \ [namespace which -command test_delete_base] \ [namespace which -command test_delete] \ - [find objects test_delete*] + [itcl::find objects test_delete*] } {{} {} {} {} {} {}} test delete-3.4 {object destructors get invoked, even during catastrophe} { @@ -148,7 +153,7 @@ test basic-4.1 {define a class where objects destroy themselves} { eval $deletecommand } method killme {code} { - delete object $this + itcl::delete object $this eval $code } } @@ -156,17 +161,17 @@ test basic-4.1 {define a class where objects destroy themselves} { test basic-4.2 {an object can delete itself} { set obj [test_delete #auto -x "data stays"] - list [$obj killme {return $x}] [find objects -isa test_delete] + list [$obj killme {return $x}] [itcl::find objects -isa test_delete] } {{data stays} {}} test basic-4.3 {the "this" variable becomes null after delete} { set obj [test_delete #auto] - list [$obj killme {return $this}] [find objects -isa test_delete] + list [$obj killme {return $this}] [itcl::find objects -isa test_delete] } {{} {}} test basic-4.4 {an object being destructed can't be deleted} { - set obj [test_delete #auto -deletecommand {delete object $this}] - list [catch {delete object $obj} msg] $msg + set obj [test_delete #auto -deletecommand {itcl::delete object $this}] + list [catch {itcl::delete object $obj} msg] $msg } {1 {can't delete an object while it is being destructed}} namespace delete test_delete @@ -185,20 +190,23 @@ test basic-5.1 {define a simple class} { test basic-5.2 {delete using a qualified name} { namespace eval test_delete2 {test_delete_name #auto} - set cmd {delete object test_delete2::test_delete_name0} - list [catch $cmd msg] $msg [find objects -isa test_delete_name] + set cmd {itcl::delete object test_delete2::test_delete_name0} + list [catch $cmd msg] $msg [itcl::find objects -isa test_delete_name] } {0 {} {}} test basic-5.3 {delete using a scoped value} { - set obj [namespace eval test_delete2 {code [test_delete_name #auto]}] - set cmd [list delete object $obj] - list [catch $cmd msg] $msg [find objects -isa test_delete_name] + set obj [namespace eval test_delete2 {itcl::code [test_delete_name #auto]}] + set cmd [list itcl::delete object $obj] + list [catch $cmd msg] $msg [itcl::find objects -isa test_delete_name] } {0 {} {}} test basic-5.4 {scoped command names are decoded properly} { - list [catch {delete object {namespace inscope ::xyzzy xxx}} msg] $msg \ - [catch {delete object {namespace inscope :: xxx yyy}} msg] $msg \ - [catch {delete object {namespace inscope :: xyzzy}} msg] $msg + list [catch {itcl::delete object {namespace inscope ::xyzzy xxx}} msg] $msg \ + [catch {itcl::delete object {namespace inscope :: xxx yyy}} msg] $msg \ + [catch {itcl::delete object {namespace inscope :: xyzzy}} msg] $msg } {1 {unknown namespace "::xyzzy"} 1 {malformed command "namespace inscope :: xxx yyy": should be "namespace inscope namesp command"} 1 {object "namespace inscope :: xyzzy" not found}} namespace delete test_delete_name test_delete2 + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/ensemble.test b/itcl/itcl/tests/ensemble.test index 21892a9fed5..e818e123aca 100644 --- a/itcl/itcl/tests/ensemble.test +++ b/itcl/itcl/tests/ensemble.test @@ -13,14 +13,19 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + test ensemble-1.1 {ensemble name must be specified} { - list [catch {ensemble} msg] $msg -} {1 {wrong # args: should be "ensemble name ?command arg arg...?"}} + list [catch {itcl::ensemble} msg] $msg +} {1 {wrong # args: should be "itcl::ensemble name ?command arg arg...?"}} test ensemble-1.2 {creating a new ensemble} { - ensemble test_numbers { + itcl::ensemble test_numbers { part one {x} { return "one: $x" } @@ -30,7 +35,7 @@ test ensemble-1.2 {creating a new ensemble} { } } "" test ensemble-1.3 {adding to an existing ensemble} { - ensemble test_numbers part three {x y z} { + itcl::ensemble test_numbers part three {x y z} { return "three: $x $y $z" } } "" @@ -52,7 +57,7 @@ test ensemble-1.6 {errors trigger a usage summary} { test ensemble-1.7 {one part can't overwrite another} { set cmd { - ensemble test_numbers part three {} { + itcl::ensemble test_numbers part three {} { return "three: new version" } } @@ -61,7 +66,7 @@ test ensemble-1.7 {one part can't overwrite another} { test ensemble-1.8 {an ensemble can't overwrite another part} { set cmd { - ensemble test_numbers ensemble three part new {} { + itcl::ensemble test_numbers ensemble three part new {} { return "three: new version" } } @@ -69,34 +74,34 @@ test ensemble-1.8 {an ensemble can't overwrite another part} { } {1 {part "three" is not an ensemble}} test ensemble-1.9 {body errors are handled gracefully} { - list [catch "ensemble test_numbers {foo bar baz}" msg] $msg $errorInfo + list [catch "itcl::ensemble test_numbers {foo bar baz}" msg] $msg $errorInfo } {1 {invalid command name "foo"} {invalid command name "foo" while executing "foo bar baz" ("ensemble" body line 1) invoked from within -"ensemble test_numbers {foo bar baz}"}} +"itcl::ensemble test_numbers {foo bar baz}"}} test ensemble-1.10 {part errors are handled gracefully} { - list [catch "ensemble test_numbers {part foo}" msg] $msg $errorInfo + list [catch "itcl::ensemble test_numbers {part foo}" msg] $msg $errorInfo } {1 {wrong # args: should be "part name args body"} {wrong # args: should be "part name args body" while executing "part foo" ("ensemble" body line 1) invoked from within -"ensemble test_numbers {part foo}"}} +"itcl::ensemble test_numbers {part foo}"}} test ensemble-1.11 {part argument errors are handled gracefully} { - list [catch "ensemble test_numbers {part foo {{}} {}}" msg] $msg $errorInfo + list [catch "itcl::ensemble test_numbers {part foo {{}} {}}" msg] $msg $errorInfo } {1 {procedure "foo" has argument with no name} {procedure "foo" has argument with no name while executing "part foo {{}} {}" ("ensemble" body line 1) invoked from within -"ensemble test_numbers {part foo {{}} {}}"}} +"itcl::ensemble test_numbers {part foo {{}} {}}"}} test ensemble-2.0 {defining subensembles} { - ensemble test_numbers { + itcl::ensemble test_numbers { ensemble hex { part base {} { return 16 @@ -158,7 +163,7 @@ test ensemble-2.6 {errors from sub-ensembles} { test ensemble-2.7 {sub-ensembles can't be accidentally redefined} { set cmd { - ensemble test_numbers part octal {args} { + itcl::ensemble test_numbers part octal {args} { return "octal: $args" } } @@ -166,7 +171,7 @@ test ensemble-2.7 {sub-ensembles can't be accidentally redefined} { } {1 {part "octal" already exists in ensemble}} test ensemble-3.0 {an error handler part can be used to handle errors} { - ensemble test_numbers { + itcl::ensemble test_numbers { part @error {args} { return "error: $args" } @@ -183,3 +188,6 @@ test ensemble-3.1 {the error handler part shows up as generic "...and"} { test_numbers three x y z test_numbers two x y ...and others described on the man page}} + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/import.test b/itcl/itcl/tests/import.test new file mode 100644 index 00000000000..af28b6e0f42 --- /dev/null +++ b/itcl/itcl/tests/import.test @@ -0,0 +1,158 @@ +# +# Tests for "auto_import" and autoloading facility +# ---------------------------------------------------------------------- +# AUTHOR: Michael J. McLennan +# Bell Labs Innovations for Lucent Technologies +# mmclennan@lucent.com +# http://www.tcltk.com/itcl +# +# RCS: $Id$ +# ---------------------------------------------------------------------- +# Copyright (c) 1993-1998 Lucent Technologies, Inc. +# ====================================================================== +# See the file "license.terms" for information on usage and +# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. + +package require tcltest +namespace import -force ::tcltest::* + +if {[string compare test [info procs test]] == 1} then {source defs} + +package require Itcl + +# ---------------------------------------------------------------------- +# Test "itcl::import::stub" command +# ---------------------------------------------------------------------- +test import-1.1 {basic syntax for "stub" command} { + list [catch {itcl::import::stub} result] $result +} {1 {wrong # args: should be one of... + stub create name + stub exists name}} + +test import-1.2 {"stub create" requires one argument} { + list [catch {itcl::import::stub create} result] $result \ + [catch {itcl::import::stub create x y} result] $result +} {1 {wrong # args: should be "itcl::import::stub create name"} 1 {wrong # args: should be "itcl::import::stub create name"}} + +test import-1.3 {"stub exists" requires one argument} { + list [catch {itcl::import::stub exists} result] $result \ + [catch {itcl::import::stub exists x y} result] $result +} {1 {wrong # args: should be "itcl::import::stub exists name"} 1 {wrong # args: should be "itcl::import::stub exists name"}} + +set interp [interp create] +$interp eval { + package require Itcl + proc auto_load {cmd {namespace {}}} { + global debug + proc $cmd {args} [format {return "%s: $args"} $cmd] + append debug "(auto_load: $cmd)" + return 1 + } +} + +test import-1.4 {"stub create" creates a stub that triggers autoloading} { + $interp eval { + set debug "" + list [itcl::import::stub create foo::bar::test] \ + [info commands ::foo::bar::test] \ + [::foo::bar::test 1 2 3] \ + $debug + } +} {{} ::foo::bar::test {::foo::bar::test: 1 2 3} {(auto_load: ::foo::bar::test)}} + +test import-1.5 {"stub exists" recognizes stubs created by "stub create"} { + $interp eval { + set debug "" + itcl::import::stub create foo::bar::stub1 + proc foo::bar::proc1 {args} {return "proc1: $args"} + list [itcl::import::stub exists foo::bar::stub1] \ + [itcl::import::stub exists foo::bar::proc1] + } +} {1 0} + +test import-1.6 {stubs can be autoloaded and replaced} { + $interp eval { + set debug "" + itcl::import::stub create foo::bar::stub2 + list [itcl::import::stub exists foo::bar::stub2] \ + [::foo::bar::stub2 a b c] \ + [itcl::import::stub exists foo::bar::stub2] \ + [::foo::bar::stub2 a b c] \ + $debug + } +} {1 {::foo::bar::stub2: a b c} 0 {::foo::bar::stub2: a b c} {(auto_load: ::foo::bar::stub2)}} + +catch {interp delete $interp} + +# ---------------------------------------------------------------------- +# Test "itcl::import::stub" command +# ---------------------------------------------------------------------- +set interp [interp create] +$interp eval { + package require Itcl + proc auto_load {cmd {namespace {}}} { + proc $cmd {args} [format {return "%s: $args"} $cmd] + return 1 + } +} + +test import-2.1 {initialize some commands for autoloading} { + $interp eval { + namespace eval test { + namespace export foo* + } + itcl::import::stub create ::test::foo1 + itcl::import::stub create ::test::foo2 + lsort [info commands ::test::*] + } +} {::test::foo1 ::test::foo2} + +test import-2.2 {stubs can be imported into other namespaces} { + $interp eval { + namespace eval user1 { namespace import ::test::* } + namespace eval user2 { namespace import ::test::* } + namespace eval user3 { namespace import ::test::* } + list [lsort [info commands ::user1::*]] \ + [namespace origin ::user1::foo1] \ + [namespace origin ::user1::foo2] + } +} {{::user1::foo1 ::user1::foo2} ::test::foo1 ::test::foo2} + +test import-2.3 {stubs can be autoloaded and imported links remain} { + $interp eval { + list [::user1::foo1 1 2 3 4] \ + [namespace origin ::user1::foo1] \ + [namespace origin ::user2::foo1] \ + [namespace origin ::user3::foo1] \ + [itcl::import::stub exists ::test::foo1] + } +} {{::test::foo1: 1 2 3 4} ::test::foo1 ::test::foo1 ::test::foo1 0} + +test import-2.3 {itcl::class handles stubs correctly} { + $interp eval { + proc auto_load {cmd {namespace {}}} { + itcl::class $cmd { } + return 1 + } + list [::user2::foo2 x] \ + [x info class] \ + [namespace origin ::user1::foo2] \ + [namespace origin ::user2::foo2] \ + [namespace origin ::user3::foo2] \ + [itcl::import::stub exists ::test::foo2] + } +} {x ::test::foo2 ::test::foo2 ::test::foo2 ::test::foo2 0} + +test import-2.3 {itcl::class will overwrite stubs in an existing namespace} { + $interp eval { + namespace eval test::buried { } + itcl::import::stub create ::test::buried + itcl::import::stub create ::test::buried::stub + list [catch {::test::buried xx} result] $result [xx info class] + } +} {0 xx ::test::buried} + +catch {interp delete $interp} + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/info.test b/itcl/itcl/tests/info.test index 34d49da2966..628d890a284 100644 --- a/itcl/itcl/tests/info.test +++ b/itcl/itcl/tests/info.test @@ -13,19 +13,24 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Class definition with one of everything # ---------------------------------------------------------------------- test info-1.1 {define a simple class} { - class test_info_base { + itcl::class test_info_base { method base {} {return "default"} variable base {} method do {args} {eval $args} } - class test_info { + itcl::class test_info { inherit test_info_base constructor {args} { @@ -89,6 +94,10 @@ test basic-1.3 {info: errors trigger usage info} { info variable ?name? ?-protection? ?-type? ?-name? ?-init? ?-value? ?-config? ...and others described on the man page}} +test info-1.4 {info: info class works on class itself} { + namespace eval test_info { info class } +} {::test_info} + # ---------------------------------------------------------------------- # Data members # ---------------------------------------------------------------------- @@ -381,4 +390,7 @@ test info-5.2 {info exists} { # ---------------------------------------------------------------------- # Clean up # ---------------------------------------------------------------------- -delete class test_info test_info_base +itcl::delete class test_info test_info_base + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/inherit.test b/itcl/itcl/tests/inherit.test index d391573dee4..e20d5065e78 100644 --- a/itcl/itcl/tests/inherit.test +++ b/itcl/itcl/tests/inherit.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Test construction/destruction with inheritance # ---------------------------------------------------------------------- @@ -99,7 +104,7 @@ test inherit-1.2 {constructors should be invoked in the proper order} { test inherit-1.3 {destructors should be invoked in the proper order} { set ::test_cd_watch "" - list [delete object test_cd_mongrel0] [set ::test_cd_watch] + list [itcl::delete object test_cd_mongrel0] [set ::test_cd_watch] } {{} {{mongrel destruct} {foobar destruct} {foo destruct} {bar destruct} {geek destruct}}} test inherit-1.4 {constructors are optional} { @@ -109,7 +114,7 @@ test inherit-1.4 {constructors are optional} { test inherit-1.5 {destructors are optional} { set ::test_cd_watch "" - list [delete object test_cd_none0] [set ::test_cd_watch] + list [itcl::delete object test_cd_none0] [set ::test_cd_watch] } {{} {{bar destruct} {geek destruct}}} test inherit-1.6 {construction ok if constructors are missing} { @@ -119,13 +124,13 @@ test inherit-1.6 {construction ok if constructors are missing} { test inherit-1.7 {destruction ok if destructors are missing} { set ::test_cd_watch "" - list [delete object test_cd_skip0] [set ::test_cd_watch] + list [itcl::delete object test_cd_skip0] [set ::test_cd_watch] } {{} {{skip destruct} {bar destruct} {geek destruct}}} test inherit-1.8 {errors during construction are cleaned up and reported} { global errorInfo test_cd_watch set test_cd_watch "" - body test_cd_bar::constructor {args} {error "bar: failed"} + itcl::body test_cd_bar::constructor {args} {error "bar: failed"} list [catch {test_cd_mongrel #auto bob} msg] $msg \ $errorInfo $test_cd_watch } {1 {bar: failed} {bar: failed @@ -144,24 +149,24 @@ test inherit-1.8 {errors during construction are cleaned up and reported} { test inherit-1.9 {errors during destruction prevent object delete} { global errorInfo test_cd_watch - body test_cd_bar::constructor {args} {return "bar: $args"} - body test_cd_bar::destructor {} {error "bar: failed"} + itcl::body test_cd_bar::constructor {args} {return "bar: $args"} + itcl::body test_cd_bar::destructor {} {error "bar: failed"} test_cd_mongrel mongrel1 ted set test_cd_watch "" - list [catch {delete object mongrel1} msg] $msg \ - $errorInfo $test_cd_watch [find objects mongrel*] + list [catch {itcl::delete object mongrel1} msg] $msg \ + $errorInfo $test_cd_watch [itcl::find objects mongrel*] } {1 {bar: failed} {bar: failed while executing "error "bar: failed"" while deleting object "::mongrel1" in ::test_cd_bar::destructor (body line 1) invoked from within -"delete object mongrel1"} {{mongrel destruct} {foobar destruct} {foo destruct}} mongrel1} +"itcl::delete object mongrel1"} {{mongrel destruct} {foobar destruct} {foo destruct}} mongrel1} test inherit-1.10 {errors during destruction prevent class delete} { - list [catch {delete class test_cd_foo} msg] $msg + list [catch {itcl::delete class test_cd_foo} msg] $msg } {1 {bar: failed}} -eval namespace delete [find classes test_cd_*] +eval namespace delete [itcl::find classes test_cd_*] # ---------------------------------------------------------------------- # Test data member access and scoping @@ -213,7 +218,7 @@ test inherit-2.4 {methods have access to shadowed data members} { [test_cd_mongrel0 test_cd_mongrel::do set test_cd_bar::x] } {foo-x foo-x bar-x foo-x bar-x} -eval namespace delete [find classes test_cd_*] +eval namespace delete [itcl::find classes test_cd_*] # ---------------------------------------------------------------------- # Test public variables and "configure" method @@ -291,7 +296,7 @@ test inherit-3.8 {"cget" does proper name resolution} { [test_cd_mongrel0 cget -test_cd_mongrel::x] } {one two three one} -eval namespace delete [find classes test_cd_*] +eval namespace delete [itcl::find classes test_cd_*] # ---------------------------------------------------------------------- # Test inheritance info @@ -355,7 +360,7 @@ test inherit-4.7 {built-in "isa" method works within methods} { } {1 1 1 1 1} test inherit-4.8 {built-in "isa" method recognizes bad classes} { - class test_cd_other {} + itcl::class test_cd_other {} test_cd_mongrel0 isa test_cd_other } {0} @@ -363,7 +368,7 @@ test inherit-4.9 {built-in "isa" method recognizes bad classes} { list [catch {test_cd_mongrel0 isa test_cd_bogus} msg] $msg } {1 {class "test_cd_bogus" not found in context "::test_cd_foo"}} -eval namespace delete [find classes test_cd_*] +eval namespace delete [itcl::find classes test_cd_*] # ---------------------------------------------------------------------- # Test "find objects" @@ -391,38 +396,38 @@ test inherit-5.2 {create objects for info tests} { } {test_cd_foo0 test_cd_foo1 test_cd_foobar0 test_cd_geek0 test_cd_mongrel0} test inherit-5.3 {find objects: -class qualifier} { - lsort [find objects -class test_cd_foo] + lsort [itcl::find objects -class test_cd_foo] } {test_cd_foo0 test_cd_foo1} test inherit-5.4 {find objects: -class qualifier} { - lsort [find objects -class test_cd_mongrel] + lsort [itcl::find objects -class test_cd_mongrel] } {test_cd_mongrel0} test inherit-5.5 {find objects: -isa qualifier} { - lsort [find objects -isa test_cd_foo] + lsort [itcl::find objects -isa test_cd_foo] } {test_cd_foo0 test_cd_foo1 test_cd_foobar0 test_cd_mongrel0} test inherit-5.6 {find objects: -isa qualifier} { - lsort [find objects -isa test_cd_mongrel] + lsort [itcl::find objects -isa test_cd_mongrel] } {test_cd_mongrel0} test inherit-5.7 {find objects: name qualifier} { - lsort [find objects test_cd_foo*] + lsort [itcl::find objects test_cd_foo*] } {test_cd_foo0 test_cd_foo1 test_cd_foobar0} test inherit-5.8 {find objects: -class and -isa qualifiers} { - lsort [find objects -isa test_cd_foo -class test_cd_foobar] + lsort [itcl::find objects -isa test_cd_foo -class test_cd_foobar] } {test_cd_foobar0} test inherit-5.9 {find objects: -isa and name qualifiers} { - lsort [find objects -isa test_cd_foo *0] + lsort [itcl::find objects -isa test_cd_foo *0] } {test_cd_foo0 test_cd_foobar0 test_cd_mongrel0} test inherit-5.10 {find objects: usage errors} { - list [catch {find objects -xyzzy} msg] $msg -} {1 {wrong # args: should be "find objects ?-class className? ?-isa className? ?pattern?"}} + list [catch {itcl::find objects -xyzzy value} msg] $msg +} {1 {wrong # args: should be "itcl::find objects ?-class className? ?-isa className? ?pattern?"}} -eval namespace delete [find classes test_cd_*] +eval namespace delete [itcl::find classes test_cd_*] # ---------------------------------------------------------------------- # Test method scoping and execution @@ -487,13 +492,16 @@ test inherit-6.8 {"previous" command no longer exists} { } {1 {invalid command name "previous"}} test inherit-6.9 {errors are detected and reported across class boundaries} { + # + # NOTE: For tcl8.2.3 and earlier the stack trace will have + # 'invoked from within "eval $args"' for the first eval + # statement. For later versions, it does not. Use + # string match to reduce the sensitivity to that. + # list [catch { test_cd_mongrel0 do test_cd_foobar0 do error "test" "some error" - } msg] $msg [set ::errorInfo] -} {1 test {some error - ("eval" body line 1) - invoked from within -"eval $args" + } msg] $msg [string match {some error + ("eval" body line 1)* (object "::test_cd_foobar0" method "::test_cd_foobar::do" body line 1) invoked from within "test_cd_foobar0 do error test {some error}" @@ -502,7 +510,8 @@ test inherit-6.9 {errors are detected and reported across class boundaries} { "eval $args" (object "::test_cd_mongrel0" method "::test_cd_mongrel::do" body line 1) invoked from within -"test_cd_mongrel0 do test_cd_foobar0 do error "test" "some error""}} +"test_cd_mongrel0 do test_cd_foobar0 do error "test" "some error""} [set ::errorInfo]] +} {1 test 1} test inherit-6.10 {errors codes are preserved across class boundaries} { list [catch { @@ -516,7 +525,7 @@ test inherit-6.11 {multi-value error codes are preserved across class boundaries } msg] $msg [set ::errorCode] } {1 test {CODE BLUE 123}} -eval namespace delete [find classes test_cd_*] +eval namespace delete [itcl::find classes test_cd_*] # ---------------------------------------------------------------------- # Test inheritance errors @@ -563,14 +572,17 @@ test inherit-7.4 {cannot have more than one inherit statement} { # Multiple base class error detection # ---------------------------------------------------------------------- test inherit-8.1 {cannot inherit from the same base class more than once} { - class test_mi_base {} - class test_mi_foo {inherit test_mi_base} - class test_mi_bar {inherit test_mi_base} + itcl::class test_mi_base {} + itcl::class test_mi_foo {inherit test_mi_base} + itcl::class test_mi_bar {inherit test_mi_base} list [catch { - class test_mi_foobar {inherit test_mi_foo test_mi_bar} + itcl::class test_mi_foobar {inherit test_mi_foo test_mi_bar} } msg] $msg } {1 {class "::test_mi_foobar" inherits base class "::test_mi_base" more than once: test_mi_foobar->test_mi_foo->test_mi_base test_mi_foobar->test_mi_bar->test_mi_base}} -delete class test_mi_base +itcl::delete class test_mi_base + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/interp.test b/itcl/itcl/tests/interp.test index e25c680bbd1..e6c64793822 100644 --- a/itcl/itcl/tests/interp.test +++ b/itcl/itcl/tests/interp.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Make sure that slave interpreters can be created and loaded # with [incr Tcl]... @@ -66,3 +71,6 @@ test interp-1.4 {one namespace can cause another to be destroyed} { } interp delete slave } {} + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/local.test b/itcl/itcl/tests/local.test index 5f288a02835..49430025431 100644 --- a/itcl/itcl/tests/local.test +++ b/itcl/itcl/tests/local.test @@ -13,13 +13,18 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Test "local" to create objects that only exist within a proc # ---------------------------------------------------------------------- test local-1.1 {define a class to use for testing} { - class test_local { + itcl::class test_local { common status "" constructor {} { lappend status "created $this" @@ -34,11 +39,11 @@ test local-1.1 {define a class to use for testing} { return $status } proc test {} { - local test_local #auto + itcl::local test_local #auto lappend status "processing" } proc test2 {} { - local test_local #auto + itcl::local test_local #auto lappend status "call test..." test lappend status "...back" @@ -60,7 +65,10 @@ test local-1.3 {} { } {{created ::test_local::test_local2} {call test...} {created ::test_local::test_local3} processing {deleted ::test_local::test_local3} ...back {deleted ::test_local::test_local2}} test local-1.4 {} { - find objects -isa test_local + itcl::find objects -isa test_local } {test_local0} -delete class test_local +itcl::delete class test_local + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/methods.test b/itcl/itcl/tests/methods.test index edb1ea88f0e..9906e889080 100644 --- a/itcl/itcl/tests/methods.test +++ b/itcl/itcl/tests/methods.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Methods with various argument lists # ---------------------------------------------------------------------- @@ -38,9 +43,17 @@ test methods-1.1 {define a class with lots of methods and arg lists} { method clash {x bang boom} { return "clash: $x $bang $boom" } + method clash_time {x bang boom} { + time {set result "clash_time: $x $bang $boom"} 1 + return $result + } proc crash {x bang boom} { return "crash: $x $bang $boom" } + proc crash_time {x bang boom} { + time {set result "crash_time: $x $bang $boom"} 1 + return $result + } variable bang "ok" common boom "no-problem" } @@ -122,7 +135,22 @@ test methods-1.10 {formal args don't clobber class members} { [ta info variable boom -value] } {0 {crash: 4 5 6} ok no-problem} +test methods-1.11 {formal args don't clobber class members, even in "time"} { + list [catch {ta clash_time 7 8 9} msg] $msg \ + [ta info variable bang -value] \ + [ta info variable boom -value] +} {0 {clash_time: 7 8 9} ok no-problem} + +test methods-1.12 {formal args don't clobber class members, even in "time"} { + list [catch {test_args::crash_time a b c} msg] $msg \ + [ta info variable bang -value] \ + [ta info variable boom -value] +} {0 {crash_time: a b c} ok no-problem} + # ---------------------------------------------------------------------- # Clean up # ---------------------------------------------------------------------- -delete class test_args +itcl::delete class test_args + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/mkindex.itcl b/itcl/itcl/tests/mkindex.itcl index fb293b6a4ec..bef0fb5358e 100644 --- a/itcl/itcl/tests/mkindex.itcl +++ b/itcl/itcl/tests/mkindex.itcl @@ -22,6 +22,7 @@ # Should be able to handle simple class definitions, even if # they are prefaced with white space. # +namespace import itcl::* namespace import blt::* class Simple1 { @@ -49,7 +50,7 @@ itcl::ensemble ens { # Should be able to handle "body" and "configbody" declarations. # body Simple2::bump {} {incr x $by} -configbody Simple2::by {if {$by <= 0} {error "bad increment}} +configbody Simple2::by {if {$by <= 0} {error "bad increment"}} # # Should be able to handle class declarations within namespaces, @@ -64,7 +65,7 @@ namespace eval buried { proc find {args} {} } body inside::bump {} {incr x $by} - configbody inside::by {if {$by <= 0} {error "bad increment}} + configbody inside::by {if {$by <= 0} {error "bad increment"}} class ::top { method skip {x y z} {} diff --git a/itcl/itcl/tests/mkindex.test b/itcl/itcl/tests/mkindex.test index 47a98b41269..bc20a242dbb 100644 --- a/itcl/itcl/tests/mkindex.test +++ b/itcl/itcl/tests/mkindex.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Test "auto_mkindex" in the presence of class definitions # ---------------------------------------------------------------------- @@ -42,3 +47,6 @@ test mkindex-1.3 {examine tclIndex} { set result } } "{::Simple2::bump $element} {::Simple2::by $element} {::buried::deep::within $element} {::buried::ens $element} {::buried::inside $element} {::buried::inside::bump $element} {::buried::inside::by $element} {::buried::inside::find $element} {::buried::under::neath $element} {::top::find $element} {::top::notice $element} {OldStyle $element} {Simple1 $element} {Simple2 $element} {ens $element} {top $element}" + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/namespace.test b/itcl/itcl/tests/namespace.test index 35a1e9cf975..31150f0f19c 100644 --- a/itcl/itcl/tests/namespace.test +++ b/itcl/itcl/tests/namespace.test @@ -13,14 +13,19 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Classes within namespaces # ---------------------------------------------------------------------- test namespace-1.1 {same class name can be used in different namespaces} { namespace eval test_ns_1 { - class Counter { + itcl::class Counter { variable num 0 method ++ {{by 1}} { incr num $by @@ -30,9 +35,10 @@ test namespace-1.1 {same class name can be used in different namespaces} { } common tag 1 } + proc exists {} { return "don't clobber me!" } } namespace eval test_ns_2 { - class Counter { + itcl::class Counter { variable num 0 method ++ {{by 2}} { if {$num == 0} { @@ -67,8 +73,21 @@ test namespace-1.4 {create an object in another namespace} { } {c 1 2 4 8} test namespace-1.5 {can find classes wrapped in a namespace} { - list [catch {test_ns_1::c do find objects -isa Counter} msg] $msg \ - [catch {test_ns_1::c do find objects -class Counter} msg] $msg -} {0 {} 0 {}} + list [catch {test_ns_1::c do itcl::find objects -isa Counter} msg] $msg \ + [catch {test_ns_1::c do itcl::find objects -class Counter} msg] $msg +} {0 ::test_ns_1::c 0 ::test_ns_1::c} + +test namespace-1.6 {can't create an object that clobbers a command in this namespace} { + list [catch {namespace eval test_ns_1 {Counter exists}} msg] $msg +} {1 {command "exists" already exists in namespace "::test_ns_1"}} + +test namespace-1.7 {can create an object that shadows a command in the global namespace} { + list [catch {namespace eval test_ns_1 {Counter lreplace}} msg] $msg \ + [catch {itcl::find objects *lreplace} msg] $msg \ + [namespace eval test_ns_1 {namespace which lreplace}] +} {0 lreplace 0 ::test_ns_1::lreplace ::test_ns_1::lreplace} namespace delete test_ns_1 test_ns_2 + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/protection.test b/itcl/itcl/tests/protection.test index acf5ee650e8..180e1137852 100644 --- a/itcl/itcl/tests/protection.test +++ b/itcl/itcl/tests/protection.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Class members are protected by access restrictions # ---------------------------------------------------------------------- @@ -294,7 +299,7 @@ test protect-2.23 {*cannot* access non-overloaded private method from base class test_pr_derived0 prom test_pr_derived0 pubm}} -eval namespace delete [find classes test_pr*] +eval namespace delete [itcl::find classes test_pr*] # ---------------------------------------------------------------------- # Access restrictions don't mess up "info" @@ -367,4 +372,7 @@ test protect-3.13 {private base class commons can be accessed from class} { } msg] $msg } {0 {private common ::test_info_base::pribc pribc-value pribc-value}} -eval namespace delete [find classes test_info*] +eval namespace delete [itcl::find classes test_info*] + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/tests/scope.test b/itcl/itcl/tests/scope.test index 8ce1e05b810..345790fb806 100644 --- a/itcl/itcl/tests/scope.test +++ b/itcl/itcl/tests/scope.test @@ -13,8 +13,13 @@ # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. +package require tcltest +namespace import -force ::tcltest::* + if {[string compare test [info procs test]] == 1} then {source defs} +package require Itcl + # ---------------------------------------------------------------------- # Syntax of the "scope" command # ---------------------------------------------------------------------- @@ -177,10 +182,10 @@ test scope-3.7 {code command provides access to methods} { test scope-3.8 {scope command allows access to slots in an array} { test_scope0 mcontext set varray(0) "defined" test_scope::pcontext set carray(0) "defined" - list [catch {test_scope0 mcontext scope varray(0)} msg] $msg \ - [catch {test_scope0 mcontext scope varray(1)} msg] $msg \ - [catch {test_scope::pcontext scope carray(0)} msg] $msg \ - [catch {test_scope::pcontext scope carray(1)} msg] $msg + list [catch {test_scope0 mcontext itcl::scope varray(0)} msg] $msg \ + [catch {test_scope0 mcontext itcl::scope varray(1)} msg] $msg \ + [catch {test_scope::pcontext itcl::scope carray(0)} msg] $msg \ + [catch {test_scope::pcontext itcl::scope carray(1)} msg] $msg } {0 {@itcl ::test_scope0 ::test_scope::varray(0)} 0 {@itcl ::test_scope0 ::test_scope::varray(1)} 0 ::test_scope::carray(0) 0 ::test_scope::carray(1)} itcl::delete class test_scope @@ -200,8 +205,11 @@ test scope-4.1 {define simple namespace with things to export} { test scope-4.2 {scope command allows access to slots in an array} { test_scope_ns::pcontext set array(0) "defined" - list [catch {test_scope_ns::pcontext scope array(0)} msg] $msg \ - [catch {test_scope_ns::pcontext scope array(1)} msg] $msg + list [catch {test_scope_ns::pcontext itcl::scope array(0)} msg] $msg \ + [catch {test_scope_ns::pcontext itcl::scope array(1)} msg] $msg } {0 ::test_scope_ns::array(0) 0 ::test_scope_ns::array(1)} namespace delete test_scope_ns + +::tcltest::cleanupTests +return diff --git a/itcl/itcl/win/Makefile.in b/itcl/itcl/win/Makefile.in index a9cb288f6da..7b5c18ff026 100644 --- a/itcl/itcl/win/Makefile.in +++ b/itcl/itcl/win/Makefile.in @@ -12,6 +12,11 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ VPATH = @srcdir@:@srcdir@/../generic:@srcdir@/../unix srcdir = @srcdir@ +libdir=@libdir@ +bindir=@bindir@ +includedir=@includedir@ +mandir=@mandir@ +datadir=@datadir@ CC = @CC@ CFLAGS = @CFLAGS@ @@ -82,21 +87,21 @@ ITCLSHRES = @ITCLSHRES@ # Directory in which to install the library of Itcl scripts and demos # (note: you can set the ITCL_LIBRARY environment variable at run-time to # override the compiled-in location): -ITCL_LIBRARY = $(prefix)/share/itcl$(ITCL_VERSION) +ITCL_LIBRARY = $(datadir)/itcl$(ITCL_VERSION) -# CYGNUS LOCAL: dj - use @dir@ form +# CYGNUS LOCAL: cgf - use autoconf variables # Directory in which to install the archive libitcl.a: -INSTALL_LIB_DIR = @libdir@ +INSTALL_LIB_DIR = $(libdir) # Directory in which to install the program itclsh: -INSTALL_BIN_DIR = @bindir@ +INSTALL_BIN_DIR = $(bindir) # Directory in which to install the include file itcl.h: -INSTALL_INCLUDE_DIR = @includedir@ +INSTALL_INCLUDE_DIR = $(includedir) # Top-level directory for manual entries: -INSTALL_MAN_DIR = @mandir@ +INSTALL_MAN_DIR = $(mandir) # Directory in which to install manual entry for itclsh: INSTALL_MAN1_DIR = $(INSTALL_MAN_DIR)/man1 @@ -219,7 +224,7 @@ $(CYGITCLTEST): $(ITCLTESTOBJS) $(CYGITCLLIB) $(TMPDIR)/$(CYGITCLSHRES) $(CC) $(linkdebug) $(conlflags) -Wl,--stack=0x2300000 \ $(ITCL_CFLAGS) \ $(ITCLTESTOBJS) $(TMPDIR)/$(CYGITCLSHRES) \ - $(CYGITCLLIB) $(TCLLIBDIR)/$(TCLLIB) $(conlibsdll) \ + $(CYGITCLLIB) $(TCLLIBDIR)/$(TCLLIB) $(conlibsdll) \ -o $(CYGITCLTEST) $(TMPDIR)/$(CYGITCLSHRES):: $(ROOT)/win/itclsh.rc @@ -306,7 +311,7 @@ config.status: $(srcdir)/configure install:: install-basic install-binaries @echo done -install-binaries:: +install-binaries:: install-shared-libraries @for i in $(INSTALL_LIB_DIR) $(INSTALL_BIN_DIR) ; \ do \ if [ ! -d $$i ] ; then \ @@ -316,12 +321,10 @@ install-binaries:: else true; \ fi; \ done; - @echo "Installing $(CYGITCLLIB) as $(INSTALL_LIB_DIR)/$(CYGITCLLIB)" - @$(INSTALL_DATA) $(CYGITCLLIB) $(INSTALL_LIB_DIR)/$(CYGITCLLIB) - @echo "Installing $(CYGITCLSH) as $(INSTALL_BIN_DIR)/$(CYGITCLSH)" - @$(INSTALL_PROGRAM) $(CYGITCLSH) $(INSTALL_BIN_DIR)/$(CYGITCLSH) - @echo "Installing $(CYGITCLDLL) as $(INSTALL_BIN_DIR)/$(CYGITCLDLL)" - @$(INSTALL_PROGRAM) $(CYGITCLDLL) $(INSTALL_BIN_DIR)/$(CYGITCLDLL) + @echo "Installing $(ITCLLIB) as $(INSTALL_LIB_DIR)/$(ITCLLIB)" + @$(INSTALL_DATA) $(ITCLLIB) $(INSTALL_LIB_DIR)/$(ITCLLIB) + @echo "Installing $(ITCLSH) as $(INSTALL_BIN_DIR)/$(ITCLSH)" + @$(INSTALL_PROGRAM) $(ITCLSH) $(INSTALL_BIN_DIR)/$(ITCLSH) # # Basic installtion @@ -346,7 +349,7 @@ install-headers: $(INSTALL_DATA) $$i $(INSTALL_INCLUDE_DIR); \ done; -install-libraries: +install-libraries: install-shared-libraries @for i in $(prefix)/lib $(ITCL_LIBRARY); \ do \ if [ ! -d $$i ] ; then \ @@ -360,6 +363,9 @@ install-libraries: @$(INSTALL_DATA) $(srcdir)/pkgIndex.tcl $(ITCL_LIBRARY) @$(INSTALL_DATA) $(srcdir)/../library/itcl.tcl $(ITCL_LIBRARY) +install-shared-libraries: + @echo "Installing $(ITCLDLL) as $(INSTALL_BIN_DIR)/$(ITCLDLL)" + @$(INSTALL_PROGRAM) $(ITCLDLL) $(INSTALL_BIN_DIR)/$(ITCLDLL) install-man: @for i in $(INSTALL_MAN_DIR) $(INSTALL_MAN1_DIR) \ diff --git a/itcl/itcl/win/dllEntryPoint.c b/itcl/itcl/win/dllEntryPoint.c index a988c0823d0..43c25c1f51d 100644 --- a/itcl/itcl/win/dllEntryPoint.c +++ b/itcl/itcl/win/dllEntryPoint.c @@ -6,9 +6,10 @@ #define WIN32_LEAN_AND_MEAN #include <windows.h> -#include <tcl.h> /* CYGNUS LOCAL */ +#include <tcl.h> + #ifdef __CYGWIN32__ /* * The following declaration is for the VC++ DLL entry point. diff --git a/itcl/itcl/win/itcl.rc b/itcl/itcl/win/itcl.rc index 305d25473fe..d9cc97ec727 100644 --- a/itcl/itcl/win/itcl.rc +++ b/itcl/itcl/win/itcl.rc @@ -3,13 +3,14 @@ // Version // +#define VS_VERSION_INFO 1 #define RESOURCE_INCLUDED #include <itcl.h> VS_VERSION_INFO VERSIONINFO - FILEVERSION ITCL_MAJOR_VERSION ,ITCL_MINOR_VERSION ,ITCL_RELEASE_LEVEL,0 - PRODUCTVERSION ITCL_MAJOR_VERSION ,ITCL_MINOR_VERSION ,ITCL_RELEASE_LEVEL,0 + FILEVERSION ITCL_MAJOR_VERSION ,ITCL_MINOR_VERSION ,ITCL_RELEASE_LEVEL + PRODUCTVERSION ITCL_MAJOR_VERSION ,ITCL_MINOR_VERSION ,ITCL_RELEASE_LEVEL FILEFLAGSMASK 0x3fL FILEFLAGS 0x0L FILEOS 0x4L @@ -20,13 +21,13 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "FileDescription", "Itcl DLL\0" + VALUE "FileDescription", "Itcl language extension for Tcl\0" VALUE "Authors", "Michael McLennan\0" - VALUE "OriginalFilename", "itcl30.dll\0" + VALUE "OriginalFilename", "itcl" STRINGIFY(ITCL_MAJOR_VERSION) STRINGIFY(ITCL_MINOR_VERSION) ".dll\0" VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0" VALUE "FileVersion", ITCL_PATCH_LEVEL VALUE "LegalCopyright", "Copyright \251 1993-1998\0" - VALUE "ProductName", "[incr Tcl] 3.0 for Windows\0" + VALUE "ProductName", "[incr Tcl] " STRINGIFY(ITCL_MAJOR_VERSION) "." STRINGIFY(ITCL_MINOR_VERSION) " for Windows\0" VALUE "ProductVersion", ITCL_PATCH_LEVEL END END diff --git a/itcl/itcl/win/itclsh.rc b/itcl/itcl/win/itclsh.rc index 217df6c76cb..6921c1d9b49 100644 --- a/itcl/itcl/win/itclsh.rc +++ b/itcl/itcl/win/itclsh.rc @@ -1,37 +1,37 @@ -// SCCS: @(#) tclsh.rc 1.14 96/09/12 14:59:29 -// -// Version -// - -#define RESOURCE_INCLUDED -#include <itcl.h> - -VS_VERSION_INFO VERSIONINFO - FILEVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL,0 - PRODUCTVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL,0 - FILEFLAGSMASK 0x3fL - FILEFLAGS 0x0L - FILEOS 0x4L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "FileDescription", "[incr Tcl] Object-Oriented Tcl Application\0" - VALUE "Authors", "Michael McLennan\0" - VALUE "OriginalFilename", "itclsh.exe\0" - VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0" - VALUE "FileVersion", ITCL_PATCH_LEVEL - VALUE "LegalCopyright", "Copyright \251 1993-1998\0" - VALUE "ProductName", "[incr Tcl] "STRINGIFY(ITCL_MAJOR_VERSION)"."STRINGIFY(ITCL_MINOR_VERSION)" for Windows\0" - VALUE "ProductVersion", ITCL_PATCH_LEVEL - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - +// SCCS: @(#) tclsh.rc 1.14 96/09/12 14:59:29
+//
+// Version
+//
+
+#define RESOURCE_INCLUDED
+#include <itcl.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL
+ PRODUCTVERSION ITCL_MAJOR_VERSION,ITCL_MINOR_VERSION,ITCL_RELEASE_LEVEL
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "[incr Tcl] Object-Oriented Tcl Application\0"
+ VALUE "Authors", "Michael McLennan\0"
+ VALUE "OriginalFilename", "itclsh.exe\0"
+ VALUE "CompanyName", "Bell Labs Innovations for Lucent Technologies\0"
+ VALUE "FileVersion", ITCL_PATCH_LEVEL
+ VALUE "LegalCopyright", "Copyright \251 1993-1998\0"
+ VALUE "ProductName", "[incr Tcl] "STRINGIFY(ITCL_MAJOR_VERSION)"."STRINGIFY(ITCL_MINOR_VERSION)" for Windows\0"
+ VALUE "ProductVersion", ITCL_PATCH_LEVEL
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
diff --git a/itcl/itcl/win/makefile.vc b/itcl/itcl/win/makefile.vc index dd97faac9ca..92a0827d0cb 100644 --- a/itcl/itcl/win/makefile.vc +++ b/itcl/itcl/win/makefile.vc @@ -1,147 +1,301 @@ -# Visual C++ 4.0 makefile -# -# Copyright (c) 1993-1996 Lucent Technologies +# Visual C++ 2.x and 4.0 makefile # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +# Copyright (c) 1993-1998 Lucent Technologies, Inc. +# RCS: $Id$ +# Does not depend on the presence of any environment variables in +# order to compile itcl; all needed information is derived from +# location of the compiler directories. # -# Project directories -# +# NOTE: Be sure to modify the "makefile.vc" file in the toplevel directory +# for the itcl distribution. Include the location of your VC++ development +# tools and the installation directory. + +!include "..\..\makefile.vc" + + # ROOT = top of source tree -# # TMPDIR = location where .obj files should be stored during build -# -!include "..\..\Makefile.vc" +ROOT = .. -ROOT = .. -TMPDIR = . -TARGET_LIB_ITCL = $(TARGET_LIB)\Itcl2.2 -TARGET_DOC_ITCL = $(TARGET_DOC)\Itcl +###################################################################### +# Do not modify below this line +###################################################################### -# Comment the following line to compile with symbols -NODEBUG=1 +NAMEPREFIX = itcl +DOTVERSION = 3.1 +VERSION = 31 +STUBPREFIX = $(NAMEPREFIX)stub -# uncomment the following two lines to compile with TCL_MEM_DEBUG -#DEBUGDEFINES = -DTCL_MEM_DEBUG +BINROOT = . +!IF "$(NODEBUG)" == "1" +TMPNAME = Release +DBGX = +!ELSE +TMPNAME = Debug +DBGX = d +!ENDIF +TMPDIR = $(BINROOT)\$(TMPNAME) +OUTDIR = $(TMPDIR) -WINDIR = $(ROOT)\win -GENERICDIR = $(ROOT)\generic +PKGINDEX = $(TMPDIR)\pkgIndex.tcl -TCL_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(TCLDIR)\generic +ITCLLIB = $(OUTDIR)\$(NAMEPREFIX)$(VERSION)$(DBGX).lib +ITCLDLLNAME = $(NAMEPREFIX)$(VERSION)$(DBGX).dll +ITCLDLL = $(OUTDIR)\$(ITCLDLLNAME) +ITCLSH = $(OUTDIR)\$(NAMEPREFIX)sh$(VERSION)$(DBGX).exe +DUMPEXTS = $(TMPDIR)\dumpexts.exe -TCL_DEFINES = -D__WIN32__ -DUSE_TCLALLOC=0 $(DEBUGDEFINES) -Dtry=__try \ - -Dexcept=__except +TCLLIB = $(TCLDIR)\win\$(OUTDIR)\tcl81$(DBGX).lib +TCLSTUBLIB = $(TCLDIR)\win\$(OUTDIR)\tclstub81$(DBGX).lib +TCLDLL = $(TCLDIR)\win\$(OUTDIR)\tcl81$(DBGX).dll + +ITCLSTUBLIBNAME = $(STUBPREFIX)$(VERSION)$(DBGX).lib +ITCLSTUBLIB = $(OUTDIR)\$(ITCLSTUBLIBNAME) + +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\itcl$(DOTVERSION) +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include ITCLSHOBJS = \ - $(TMPDIR)\tclAppInit.obj + $(TMPDIR)\tclAppInit.obj ITCLOBJS = \ - $(TMPDIR)\itcl_bicmds.obj \ - $(TMPDIR)\itcl_class.obj \ - $(TMPDIR)\itcl_cmds.obj \ - $(TMPDIR)\itcl_linkage.obj \ - $(TMPDIR)\itcl_methods.obj \ - $(TMPDIR)\itcl_objects.obj \ - $(TMPDIR)\itcl_obsolete.obj \ - $(TMPDIR)\itcl_parse.obj \ - $(TMPDIR)\itcl_util.obj \ - $(TMPDIR)\dllEntryPoint.obj - -DUMPEXTS = $(TCLLIBDIR)\dumpexts.exe -ITCLSH = itclsh.exe -ITCLTEST = itcltest.exe - -CPU = i386 -INCLUDE = $(TOOLS32)\include -!include <ntwin32.mak> - -TCL_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) $(TCL_INCLUDES) $(TCL_DEFINES) -CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE -DOS_CFLAGS = $(cdebug) $(cflags) $(include16) -AL -DLL16_CFLAGS = $(cdebug) $(cflags) $(include16) -ALw + $(TMPDIR)\itclStubInit.obj \ + $(TMPDIR)\itcl_bicmds.obj \ + $(TMPDIR)\itcl_class.obj \ + $(TMPDIR)\itcl_cmds.obj \ + $(TMPDIR)\itcl_ensemble.obj \ + $(TMPDIR)\itcl_linkage.obj \ + $(TMPDIR)\itcl_migrate.obj \ + $(TMPDIR)\itcl_methods.obj \ + $(TMPDIR)\itcl_objects.obj \ + $(TMPDIR)\itcl_obsolete.obj \ + $(TMPDIR)\itcl_parse.obj \ + $(TMPDIR)\itcl_util.obj \ + $(TMPDIR)\dllEntryPoint.obj -# -# Targets -# +ITCLSTUBOBJS = \ + $(TMPDIR)\itclStubLib.obj + +cc32 = $(TOOLS32)\bin\cl.exe +link32 = $(TOOLS32)\bin\link.exe +rc32 = $(TOOLS32_rc)\bin\rc.exe +include32 = -I$(TOOLS32)\include +lib32 = "$(TOOLS32)\bin\lib.exe" + +WINDIR = $(ROOT)\win +GENERICDIR = $(ROOT)\generic + +ITCL_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) -I$(TCLDIR)\generic +ITCL_DEFINES = -D__WIN32__ -DBUILD_itcl $(DEBUGDEFINES) + +ITCL_EXE_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \ + $(ITCL_INCLUDES) $(ITCL_DEFINES) + +ITCL_CFLAGS = $(ITCL_EXE_CFLAGS) -DUSE_TCL_STUBS + +###################################################################### +# Link flags +###################################################################### + +!IF "$(NODEBUG)" == "1" +ldebug = /RELEASE +!ELSE +ldebug = -debug:full -debugtype:cv +!ENDIF + +# declarations common to all linker options +lcommon = /NODEFAULTLIB /RELEASE /NOLOGO + +# declarations for use on Intel i386, i486, and Pentium systems +!IF "$(MACHINE)" == "IX86" +DLLENTRY = @12 +lflags = $(lcommon) /MACHINE:$(MACHINE) +!ELSE +lflags = $(lcommon) /MACHINE:$(MACHINE) +!ENDIF + +conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup +guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup +dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll + +!IF "$(MACHINE)" == "PPC" +libc = libc.lib +libcdll = crtdll.lib +!ELSE +libc = libc.lib oldnames.lib +libcdll = msvcrt.lib oldnames.lib +!ENDIF + +baselibs = kernel32.lib $(optlibs) advapi32.lib user32.lib +winlibs = $(baselibs) gdi32.lib comdlg32.lib winspool.lib + +guilibs = $(libc) $(winlibs) +conlibs = $(libc) $(baselibs) +guilibsdll = $(libcdll) $(winlibs) +conlibsdll = $(libcdll) $(baselibs) + +###################################################################### +# Compile flags +###################################################################### -release: $(ITCLDLL) $(ITCLSH) -all: $(ITCLDLL) $(ITCLSH) -test: $(ITCLSH) - $(CP) $(TCLLIBDIR)\*.dll - $(ITCLSH) << - cd ../tests - source all +!IF "$(NODEBUG)" == "1" +!IF "$(MACHINE)" == "ALPHA" +# MSVC on Alpha doesn't understand -Ot +cdebug = -O2i -Gs -GD +!ELSE +cdebug = -Oti -Gs -GD +!ENDIF +!ELSE +cdebug = -Z7 -Od -WX +!ENDIF + +# declarations common to all compiler options +ccommon = -c -W3 -nologo -YX -Fp$(TMPDIR)\ -Dtry=__try -Dexcept=__except + +!IF "$(MACHINE)" == "IX86" +cflags = $(ccommon) -D_X86_=1 +!ELSE +!IF "$(MACHINE)" == "MIPS" +cflags = $(ccommon) -D_MIPS_=1 +!ELSE +!IF "$(MACHINE)" == "PPC" +cflags = $(ccommon) -D_PPC_=1 +!ELSE +!IF "$(MACHINE)" == "ALPHA" +cflags = $(ccommon) -D_ALPHA_=1 +!ENDIF +!ENDIF +!ENDIF +!ENDIF + +cvars = -DWIN32 -D_WIN32 +cvarsmt = $(cvars) -D_MT +cvarsdll = $(cvarsmt) -D_DLL + +!IF "$(NODEBUG)" == "1" +cvarsdll = $(cvars) -MD +!ELSE +cvarsdll = $(cvars) -MDd +!ENDIF + +CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE + +###################################################################### +# Project specific targets +###################################################################### + +release: setup $(ITCLDLL) $(ITCLSTUBLIB) $(ITCLSH) +all: setup $(ITCLDLL) $(ITCLSTUBLIB) $(ITCLSH) +test: setup $(ITCLDLL) $(ITCLSTUBLIB) $(PKGINDEX) + -@copy $(TCLDLL) $(TMPDIR) + $(TCLSH) << + cd ../tests + lappend auto_path ../win/$(TMPNAME) + set env(ITCL_LIBRARY) ../library + source all << -install: all - $(MKDIR) "$(TARGET_ROOT)" - $(MKDIR) "$(TARGET_BIN)" - $(MKDIR) "$(TARGET_LIB_ROOT)" - $(MKDIR) "$(TARGET_LIB)" - $(MKDIR) "$(TARGET_LIB_ITCL)" - $(MKDIR) "$(TARGET_INCLUDE_ROOT)" - $(MKDIR) "$(TARGET_INCLUDE)" - $(MKDIR) "$(TARGET_DOC)" - $(MKDIR) "$(TARGET_DOC_ITCL)" - $(CP) $(TMPDIR)\$(ITCLSH) "$(TARGET_BIN)" - $(CP) $(TMPDIR)\$(ITCLDLL) "$(TARGET_BIN)" - $(CP) $(ROOT)\generic\itcl.h "$(TARGET_INCLUDE)" - $(CP) $(ROOT)\library\*.* "$(TARGET_LIB_ITCL)" - $(CP) $(ROOT)\win\*.tcl "$(TARGET_LIB_ITCL)" - $(CP) $(ROOT)\..\html\Itcl\*.* "$(TARGET_DOC_ITCL)" - -$(ITCLDLL): $(ITCLOBJS) $(TCLLIBDIR)\$(TCLLIB) $(TMPDIR)\itclvc.def $(TMPDIR)\itcl.res - set LIB=$(TOOLS32)\lib - $(link32) $(linkdebug) $(dlllflags) -def:$(TMPDIR)\itclvc.def \ - -out:$@ $(TMPDIR)\itcl.res $(guilibsdll) @<< -$(ITCLOBJS) $(TCLLIBDIR)\$(TCLLIB) +$(PKGINDEX): + -@copy pkgIndex.tcl $@ + +setup: + if not exist $(TMPDIR) mkdir $(TMPDIR) + if not exist $(OUTDIR) mkdir $(OUTDIR) + +$(ITCLLIB): $(ITCLDLL) + +$(ITCLDLL): $(ITCLOBJS) $(TMPDIR)\itclvc.def $(TMPDIR)\itcl.res + set LIB=$(TOOLS32)\lib + $(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\itclvc.def \ + -out:$@ $(TMPDIR)\itcl.res $(guilibsdll) $(TCLSTUBLIB) @<< + $(ITCLOBJS) << -$(ITCLSH): $(ITCLSHOBJS) $(ITCLLIB) $(TCLLIBDIR)\$(TCLLIB) $(TMPDIR)\itclsh.res - set LIB=$(TOOLS32)\lib - $(link32) $(linkdebug) $(conlflags) $(TMPDIR)\itclsh.res \ - -out:$@ $(conlibsdll) $(ITCLLIB) $(TCLLIBDIR)\$(TCLLIB) $(ITCLSHOBJS) +$(ITCLSTUBLIB): $(ITCLSTUBOBJS) + $(lib32) -nologo -out:$@ $(ITCLSTUBOBJS) -$(ITCLTEST): $(ITCLTESTOBJS) $(ITCLLIB) $(TCLLIBDIR)\$(TCLLIB) $(TMPDIR)\itclsh.res - set LIB=$(TOOLS32)\lib - $(link32) $(linkdebug) $(conlflags) $(TMPDIR)\itclsh.res \ - -out:$@ $(conlibsdll) $(ITCLLIB) $(TCLLIBDIR)\$(TCLLIB) $(ITCLTESTOBJS) +$(ITCLSH): $(ITCLSHOBJS) $(ITCLSTUBLIB) $(TCLSTUBLIB) $(TMPDIR)\itclsh.res + set LIB=$(TOOLS32)\lib + $(link32) $(ldebug) $(conlflags) $(TMPDIR)\itclsh.res -stack:2300000 \ + -out:$@ $(conlibsdll) $(ITCLLIB) $(TCLLIB) $(ITCLSHOBJS) + +$(TMPDIR)\itclvc.def: $(DUMPEXTS) $(ITCLOBJS) + $(DUMPEXTS) -o $@ $(ITCLDLLNAME) @<< +$(ITCLOBJS) +<< + +$(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c + $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $? + set LIB=$(TOOLS32)\lib + $(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \ + $(TMPDIR)\winDumpExts.obj + +install: all + if not exist $(INSTALLDIR) mkdir $(INSTALLDIR) + if not exist $(BIN_INSTALL_DIR) mkdir $(BIN_INSTALL_DIR) + if not exist $(LIB_INSTALL_DIR) mkdir $(LIB_INSTALL_DIR) + if not exist $(SCRIPT_INSTALL_DIR) mkdir $(SCRIPT_INSTALL_DIR) + if not exist $(INCLUDE_INSTALL_DIR) mkdir $(INCLUDE_INSTALL_DIR) + copy $(ITCLSH) "$(BIN_INSTALL_DIR)" + copy $(ITCLDLL) "$(BIN_INSTALL_DIR)" + copy $(ROOT)\generic\itcl.h "$(INCLUDE_INSTALL_DIR)" + copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)" + copy $(ROOT)\win\*.tcl "$(SCRIPT_INSTALL_DIR)" + +# +# Regenerate the stubs files. +# +genstubs: + $(TCLSH) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \ + $(GENERICDIR)\itcl.decls $(GENERICDIR)\itclInt.decls # # Special case object file targets # -$(TMPDIR)\itclvc.def: $(DUMPEXTS) $(ITCLOBJS) - $(DUMPEXTS) -o $@ $(ITCLDLL) @<< -$(ITCLOBJS) -<< +$(TMPDIR)\tclAppInit.obj : $(WINDIR)\tclAppInit.c + $(cc32) $(ITCL_EXE_CFLAGS) -Fo$@ $? + +# The following object is part of the stub library and should not +# be built as DLL objects but none of the symbols should be exported -$(TMPDIR)\testMain.obj: $(WINDIR)\tclAppInit.c - $(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$(TMPDIR)\testMain.obj $? +$(TMPDIR)\itclStubLib.obj : $(GENERICDIR)\itclStubLib.c + $(cc32) -DSTATIC_BUILD $(ITCL_CFLAGS) -Fo$@ $? # # Implicit rules # {$(WINDIR)}.c{$(TMPDIR)}.obj: - $(cc32) $(TCL_CFLAGS) -Fo$(TMPDIR)\ $< + $(cc32) -DDLL_BUILD $(ITCL_CFLAGS) -Fo$(TMPDIR)\ $< {$(GENERICDIR)}.c{$(TMPDIR)}.obj: - $(cc32) $(TCL_CFLAGS) -Fo$(TMPDIR)\ $< + $(cc32) -DDLL_BUILD $(ITCL_CFLAGS) -Fo$(TMPDIR)\ $< {$(ROOT)\compat}.c{$(TMPDIR)}.obj: - $(cc32) $(TCL_CFLAGS) -Fo$(TMPDIR)\ $< + $(cc32) -DDLL_BUILD $(ITCL_CFLAGS) -Fo$(TMPDIR)\ $< {$(WINDIR)}.rc{$(TMPDIR)}.res: - $(rc32) -fo $@ -r -i $(GENERICDIR) -i $(WINDIR) -i $(TCLDIR)\generic $(TCL_DEFINES) $< + $(rc32) -fo $@ -r -i $(GENERICDIR) -i $(WINDIR) -i $(TCLDIR)\generic -D__WIN32__ \ + $(ITCL_DEFINES) $< clean: - -@$(RM) *.exe - -@$(RM) *.lib - -@$(RM) *.dll - -@$(RM) *.res - -@$(RM) itclvc.def - -@$(RM) $(TMPDIR)\*.obj - -@$(RM) *.exp + -@del $(OUTDIR)\*.exp + -@del $(OUTDIR)\*.lib + -@del $(OUTDIR)\*.dll + -@del $(OUTDIR)\*.exe + -@del $(OUTDIR)\*.pdb + -@del $(TMPDIR)\*.pch + -@del $(TMPDIR)\*.obj + -@del $(TMPDIR)\*.res + -@del $(TMPDIR)\*.def + -@del $(TMPDIR)\*.exe + -@rmdir $(OUTDIR) + -@rmdir $(TMPDIR) diff --git a/itcl/itcl/win/pkgIndex.tcl b/itcl/itcl/win/pkgIndex.tcl index b09e5d73ef1..28f0467bfbf 100644 --- a/itcl/itcl/win/pkgIndex.tcl +++ b/itcl/itcl/win/pkgIndex.tcl @@ -1,3 +1,3 @@ # Tcl package index file, version 1.0 -package ifneeded Itcl 3.0 [list load itcl30.dll Itcl] +package ifneeded Itcl 3.1 [list load [file join $dir itcl31.dll] Itcl] |