Compare commits

..
Author SHA1 Message Date
cvs 0e9252a659 Creating branch scriptics-sc-1-0-branch 1999-09-21 18:32:26 +00:00
149 changed files with 10749 additions and 15763 deletions
-1
View File
@@ -1 +0,0 @@
u
-27
View File
@@ -1,27 +0,0 @@
NOTICE: This ChangeLog is no longer being maintained. To examine
the series of changes checked into Itk sources, follow the Timeline
https://core.tcl.tk/itk/timeline
2014-09-07 Arnulf P. Wiedemann <wiede@users.sf.net>
* generic/itkArchetype.c: Fix for SF bug #253.
2013-02-03 Arnulf P. Wiedemann <wiede@users.sf.net>
* bumped version to 4.0.0 for release
* added tools directory
* Makefile.in: added genstubs tag for generating stubs entries
* generic/itkArchBase.c: fixed some param types to fit to itcl changes
2011-04-29 Arnulf P. Wiedemann <wiede@users.sf.net>
* configure, configure.in, generic/itk.h: Bump version to 4.0b6
2010-08-17 Jeff Hobbs <jeffh@ActiveState.com>
* configure, configure.in, generic/itk.h: Bump version to 4.0b5
* tclconfig/tcl.m4: full update to TEA 3.9
2007-09-08 Arnulf P. Wiedemann <wiede@users.sf.net>
* all new modules installed and added
This is the ChangeLog file for itcl-ng/itk
it is here as Itk and itcl-ng/itk will be different modules in the future
+286 -307
View File
@@ -7,179 +7,223 @@
# replaced in the actual Makefile.
#
# Copyright (c) 1999 Scriptics Corporation.
# Copyright (c) 2002-2005 ActiveState Corporation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: Makefile.in,v 1.8 1999/09/21 18:32:25 wart Exp $
#========================================================================
# Add additional lines to handle any additional AC_SUBST cases that
# have been added in a customized configure script.
#========================================================================
#SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@
#========================================================================
# Nothing of the variables below this line should need to be changed.
# Please check the TARGETS section below to make sure the make targets
# are correct.
# Edit the following few lines when writing a new extension
#========================================================================
#========================================================================
# The names of the source files is defined in the configure script.
# The object files are used for linking into the final library.
# 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=$(itk_LIB_FILE) $(itkstub_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.
# It is not important to specify the directory, as long as it is the
# $(srcdir) or in the generic, win or unix subdirectory.
#========================================================================
PKG_SOURCES = @PKG_SOURCES@
PKG_OBJECTS = @PKG_OBJECTS@
WIN_DIR=$(srcdir)/win
UNIX_DIR=$(srcdir)/unix
GENERIC_DIR=$(srcdir)/generic
PLATFORM_DIR=@PLATFORM_DIR@
PKG_STUB_SOURCES = @PKG_STUB_SOURCES@
PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@
WIN_SOURCES=$(PLATFORM_DIR)/tclAppInit.c \
$(PLATFORM_DIR)/dllEntryPoint.c
UNIX_SOURCES=$(PLATFORM_DIR)/tclAppInit.c
GENERIC_SOURCES = $(GENERIC_DIR)/itk_cmds.c \
$(GENERIC_DIR)/itk_option.c \
$(GENERIC_DIR)/itk_archetype.c \
$(GENERIC_DIR)/itk_util.c \
$(GENERIC_DIR)/itkStubInit.c \
$(GENERIC_DIR)/itkStubLib.c
PLATFORM_SOURCES = @PLATFORM_SOURCES@
itk_SOURCES = $(PLATFORM_SOURCES) $(GENERIC_SOURCES)
SOURCES = $(itk_SOURCES)
#========================================================================
# PKG_TCL_SOURCES identifies Tcl runtime files that are associated with
# this package that need to be installed, if any.
# 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.
#
#========================================================================
PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
WIN_OBJECTS = dllEntryPoint.$(OBJEXT)
UNIX_OBJECTS =
GENERIC_OBJECTS = itk_cmds.$(OBJEXT) \
itk_option.$(OBJEXT) \
itk_archetype.$(OBJEXT) \
itk_util.$(OBJEXT) \
itkStubInit.$(OBJEXT) \
itkStubLib.$(OBJEXT)
PLATFORM_OBJECTS = @PLATFORM_OBJECTS@
itk_OBJECTS = $(PLATFORM_OBJECTS) $(GENERIC_OBJECTS)
itkstub_OBJECTS = itkStubLib.$(OBJEXT)
OBJECTS = $(itk_OBJECTS) $(itkstub_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.
#========================================================================
itk_LIB_FILE = @itk_LIB_FILE@
$(itk_LIB_FILE)_OBJECTS = $(itk_OBJECTS)
itkstub_LIB_FILE = @itkstub_LIB_FILE@
$(itkstub_LIB_FILE)_OBJECTS = $(itkstub_OBJECTS)
itclstub_LIB_FILE = @itclstub_LIB_FILE@
tkstub_LIB_SPEC = @tkstub_LIB_SPEC@
#========================================================================
# This is a list of header files to be installed
# itk.h includes itclInt.h, which needs itclIntDecls.h,
# so we must install them.
#========================================================================
PKG_HEADERS = @PKG_HEADERS@
GENERIC_HDRS= \
$(srcdir)/generic/itk.h
#========================================================================
# "PKG_LIB_FILE" refers to the library (dynamic or static as per
# configuration options) composed of the named objects.
# Add additional lines to handle any additional AC_SUBST cases that
# have been added to the configure script.
#========================================================================
PKG_LIB_FILE = @PKG_LIB_FILE@
PKG_LIB_FILE8 = @PKG_LIB_FILE8@
PKG_LIB_FILE9 = @PKG_LIB_FILE9@
PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@
SAMPLE_NEW_VAR=@SAMPLE_NEW_VAR@
lib_BINARIES = $(PKG_LIB_FILE)
BINARIES = $(lib_BINARIES)
ITK_LIBRARY = $(prefix)/lib/itk$(VERSION)
SHELL = @SHELL@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datarootdir = @datarootdir@
runstatedir = @runstatedir@
datadir = @datadir@
mandir = @mandir@
DESTDIR =
PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
pkgdatadir = $(datadir)/$(PKG_DIR)
pkglibdir = $(libdir)/$(PKG_DIR)
pkgincludedir = $(includedir)/$(PKG_DIR)
top_builddir = @abs_top_builddir@
INSTALL_OPTIONS =
INSTALL = @INSTALL@ $(INSTALL_OPTIONS)
INSTALL_DATA_DIR = @INSTALL_DATA_DIR@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_LIBRARY = @INSTALL_LIBRARY@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
CC = @CC@
CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
CFLAGS_WARNING = @CFLAGS_WARNING@
EXEEXT = @EXEEXT@
LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@
MAKE_LIB = @MAKE_LIB@
MAKE_SHARED_LIB = @MAKE_SHARED_LIB@
MAKE_STATIC_LIB = @MAKE_STATIC_LIB@
MAKE_STUB_LIB = @MAKE_STUB_LIB@
OBJEXT = @OBJEXT@
RANLIB = @RANLIB@
RANLIB_STUB = @RANLIB_STUB@
SHLIB_CFLAGS = @SHLIB_CFLAGS@
SHLIB_LD = @SHLIB_LD@
SHLIB_LD_LIBS = @SHLIB_LD_LIBS@
STLIB_LD = @STLIB_LD@
#TCL_DEFS = @TCL_DEFS@
TCL_BIN_DIR = @TCL_BIN_DIR@
TCL_SRC_DIR = @TCL_SRC_DIR@
TK_SRC_DIR = @TK_SRC_DIR@
TK_BIN_DIR = @TK_BIN_DIR@
ITCL_TOOLS_DIR = @itcl_SRC_DIR@/tools
# Not used, but retained for reference of what libs Tcl required
#TCL_LIBS = @TCL_LIBS@
ITK_GENERIC_DIR_NATIVE = @ITK_GENERIC_DIR_NATIVE@
ITK_UNIX_DIR_NATIVE = @ITK_UNIX_DIR_NATIVE@
ITK_WIN_DIR_NATIVE = @ITK_WIN_DIR_NATIVE@
#========================================================================
# TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our
# package without installing. The other environment variables allow us
# to test against an uninstalled Tcl. Add special env vars that you
# require for testing here (like TCLX_LIBRARY).
# 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.
#========================================================================
#EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR)
EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR)
TCLLIBPATH = $(top_builddir) @itcl_BIN_DIR@
TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library`
PKG_ENV = @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \
PATH="$(EXTRA_PATH):$(PATH)" \
ITCL_LIBRARY=`@CYGPATH@ @itcl_SRC_DIR@/library` \
ITK_LIBRARY=`@CYGPATH@ $(srcdir)/library` \
TCLLIBPATH="$(TCLLIBPATH)"
SHELL = @SHELL@
TCLSH_PROG = @TCLSH_PROG@
TCLSH = $(TCLSH_ENV) $(PKG_ENV) $(TCLSH_PROG)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
WISH_ENV = TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library`
WISH_PROG = @WISH_PROG@
WISH = $(PKG_ENV) $(TCLSH_ENV) $(WISH_ENV) $(WISH_PROG)
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
SHARED_BUILD = @SHARED_BUILD@
DESTDIR =
#INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@
INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@
pkgdatadir = $(datadir)/@PACKAGE@@VERSION@
pkglibdir = $(libdir)/@PACKAGE@@VERSION@
pkgincludedir = $(includedir)/@PACKAGE@@VERSION@
PKG_CFLAGS = @PKG_CFLAGS@
top_builddir = .
# TCL_DEFS is not strictly need here, but if you remove it, then you
# must make sure that configure.ac checks for the necessary components
# that your library may use. TCL_DEFS can actually be a problem if
# you do not compile with a similar machine setup as the Tcl core was
# compiled with.
#DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS)
DEFS = @DEFS@ $(PKG_CFLAGS) -DITK_LIBRARY=\"$(pkglibdir)\"
INSTALL = $(top_srcdir)/../config/install-sh -c
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_FLAG =
transform = @program_transform_name@
CONFIG_CLEAN_FILES = @CONFIG_CLEAN_FILES@ Makefile itkConfig.sh pkgIndex.tcl
CLEANFILES = @CLEANFILES@
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
CPPFLAGS = @CPPFLAGS@
LIBS = @PKG_LIBS@ @LIBS@
AR = @AR@
CFLAGS = @CFLAGS@ -DTCL_NO_DEPRECATED
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
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@
TK_TOP_DIR_NATIVE = $(TK_SRC_DIR)
TK_SRC_DIR = @TK_SRC_DIR@
TCLSH_PROG = @TCLSH_PROG@
TK_XINCLUDES = @TK_XINCLUDES@
TCL_INCLUDES = @TCL_INCLUDES@
TK_INCLUDES = @TK_INCLUDES@
ITCL_INCLUDES = @ITCL_INCLUDES@
ITK_INCLUDES = @ITCL_INCLUDES@ @ITK_INCLUDES@ @TK_XINCLUDES@
GDB = gdb
VALGRIND = valgrind
VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \
--leak-check=yes --show-reachable=yes -v
AUTOCONF = autoconf
.SUFFIXES: .c .$(OBJEXT)
LDFLAGS = $(LDFLAGS_DEFAULT)
INCLUDES = @TCL_INCLUDES@ @TK_INCLUDES@ $(ITK_INCLUDES)
EXTRA_CFLAGS = $(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) $(NO_DEPRECATED_FLAGS)
DEFS = @DEFS@ $(EXTRA_CFLAGS) -DITK_LIBRARY=\"$(ITK_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
@@ -187,7 +231,7 @@ VALGRINDARGS = --tool=memcheck --num-callers=8 --leak-resolution=high \
#========================================================================
# TEA TARGETS. Please note that the "libraries:" target refers to platform
# independent files, and the "binaries:" target includes executable programs and
# 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.
@@ -206,12 +250,6 @@ binaries: $(BINARIES)
libraries:
#========================================================================
# Your doc target should differentiate from doc builds (by the developer)
# and doc installs (see install-doc), which just install the docs on the
# end user machine when building from source.
#========================================================================
doc:
install: all install-binaries install-libraries install-doc
@@ -223,11 +261,16 @@ install-binaries: binaries install-lib-binaries install-bin-binaries
#========================================================================
install-libraries: libraries
@$(INSTALL_DATA_DIR) "$(DESTDIR)$(includedir)"
@echo "Installing header files in $(DESTDIR)$(includedir)"
@list='$(PKG_HEADERS)'; for i in $$list; do \
echo "Installing $(srcdir)/$$i" ; \
$(INSTALL_DATA) $(srcdir)/$$i "$(DESTDIR)$(includedir)" ; \
$(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 $(ITK_LIBRARY)"
@for i in $(srcdir)/library/*.* $(srcdir)/library/tclIndex ; do \
echo "Installing $$i" ; \
$(INSTALL_DATA) $$i $(ITK_LIBRARY) ; \
done;
#========================================================================
@@ -236,148 +279,81 @@ install-libraries: libraries
#========================================================================
install-doc: doc
@$(INSTALL_DATA_DIR) "$(DESTDIR)$(mandir)/mann"
@echo "Installing documentation in $(DESTDIR)$(mandir)"
@list='$(srcdir)/doc/*.n'; for i in $$list; do \
if test X"$$i" = X'$(srcdir)/doc/*.n'; then break; fi; \
bi=`basename $$i`; \
echo "Installing $$bi"; \
sed -e '/man\.macros/r $(srcdir)/doc/man.macros' -e '/man\.macros/d' $$i > $$bi.tmp \
&& $(INSTALL_DATA) $$bi.tmp "$(DESTDIR)$(mandir)/mann/$$bi" \
&& rm -f $$bi.tmp; \
done
$(mkinstalldirs) $(mandir)/mann
@echo "Installing man pages in $(mandir)"
@for i in $(srcdir)/doc/*.n; \
do \
echo "Installing $$i"; \
rm -f $(mandir)/mann/$$i; \
$(INSTALL_DATA) $$i $(mandir)/mann ; \
done
test: binaries libraries
$(WISH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS) -load "package require -exact itk $(PACKAGE_VERSION)"
shell: binaries libraries
@$(WISH) $(SCRIPT)
gdb:
$(TCLSH_ENV) $(PKG_ENV) $(GDB) $(WISH_PROG) $(SCRIPT)
gdb-test: binaries libraries
$(TCLSH_ENV) $(PKG_ENV) $(GDB) \
--args $(WISH_PROG) `@CYGPATH@ $(srcdir)/tests/all.tcl` \
$(TESTFLAGS) -singleproc 1 \
-load "package ifneeded $(PACKAGE_NAME) $(PACKAGE_VERSION) \
[list load `@CYGPATH@ $(PKG_LIB_FILE)` $(PACKAGE_NAME)]"
valgrind: binaries libraries
$(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(WISH_PROG) \
`@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
valgrindshell: binaries libraries
$(TCLSH_ENV) $(PKG_ENV) $(VALGRIND) $(VALGRINDARGS) $(WISH_PROG) $(SCRIPT)
test:
depend:
genstubs: $(ITCL_TOOLS_DIR)/genStubs.tcl $(srcdir)/generic/itk.decls
$(TCLSH) $(ITCL_TOOLS_DIR)/genStubs.tcl $(srcdir)/generic $(srcdir)/generic/itk.decls
#========================================================================
# $(PKG_LIB_FILE) should be listed as part of the BINARIES variable
# mentioned above. That will ensure that this target is built when you
# run "make binaries".
# 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.
#
# The $(PKG_OBJECTS) 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.
#========================================================================
$(PKG_LIB_FILE): $(PKG_OBJECTS)
-rm -f $(PKG_LIB_FILE)
${MAKE_LIB}
$(RANLIB) $(PKG_LIB_FILE)
$(itk_LIB_FILE): $(itk_OBJECTS)
-rm -f $(itk_LIB_FILE)
@MAKE_LIB@
$(RANLIB) $(itk_LIB_FILE)
$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS)
-rm -f $(PKG_STUB_LIB_FILE)
${MAKE_STUB_LIB}
$(RANLIB_STUB) $(PKG_STUB_LIB_FILE)
$(itkstub_LIB_FILE): $(itkstub_OBJECTS)
-rm -f $(itkstub_LIB_FILE)
@MAKE_STATIC_LIB@
$(RANLIB) $(itkstub_LIB_FILE)
#========================================================================
# 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:
#
# sample.$(OBJEXT): $(srcdir)/generic/sample.c
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@
#
# Setting the VPATH variable to a list of paths will cause the makefile
# to look into these paths when resolving .c to .obj dependencies.
# As necessary, add $(srcdir):$(srcdir)/compat:....
# exampleA.$(OBJEXT): $(srcdir)/src/win/exampleA.c
# $(COMPILE) -c `@CYGPATH@ $(srcdir)/src/win/exampleA.c` -o $@
#========================================================================
VPATH = $(srcdir)/unix:$(srcdir)/generic:$(srcdir)/win
dllEntryPoint.$(OBJEXT): $(WIN_DIR)/dllEntryPoint.c
$(COMPILE) -c `@CYGPATH@ $(WIN_DIR)/dllEntryPoint.c` -o $@
.c.@OBJEXT@:
$(COMPILE) -c `@CYGPATH@ $<` -I. -o $@
tclAppInit.$(OBJEXT): $(PLATFORM_DIR)/tclAppInit.c
$(COMPILE) -c `@CYGPATH@ $(PLATFORM_DIR)/tclAppInit.c` -o $@
itkBase.@OBJEXT@: itkUuid.h
itkStubInit.$(OBJEXT): $(GENERIC_DIR)/itkStubInit.c
$(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itkStubInit.c` -o $@
$(srcdir)/manifest.uuid:
printf "git-" >$(srcdir)/manifest.uuid
(cd $(srcdir); git rev-parse HEAD >>$(srcdir)/manifest.uuid || \
(printf "svn-r" >$(srcdir)/manifest.uuid ; \
svn info --show-item last-changed-revision >>$(srcdir)/manifest.uuid) || \
printf "unknown" >$(srcdir)/manifest.uuid)
itkStubLib.$(OBJEXT): $(GENERIC_DIR)/itkStubLib.c
$(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itkStubLib.c` -o $@
itkUuid.h: $(srcdir)/manifest.uuid
echo "#define ITK_VERSION_UUID \\" >$@
cat $(srcdir)/manifest.uuid >>$@
echo "" >>$@
itk_cmds.$(OBJEXT): $(GENERIC_DIR)/itk_cmds.c
$(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itk_cmds.c` -o $@
#========================================================================
# Distribution creation
# You may need to tweak this target to make it work correctly.
#========================================================================
itk_option.$(OBJEXT): $(GENERIC_DIR)/itk_option.c
$(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itk_option.c` -o $@
#COMPRESS = tar cvf $(PKG_DIR).tar $(PKG_DIR); compress $(PKG_DIR).tar
COMPRESS = tar zcvf $(PKG_DIR).tar.gz $(PKG_DIR)
DIST_ROOT = /tmp/dist
DIST_DIR = $(DIST_ROOT)/$(PKG_DIR)
itk_archetype.$(OBJEXT): $(GENERIC_DIR)/itk_archetype.c
$(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itk_archetype.c` -o $@
DIST_INSTALL_DATA = CPPROG='cp -p' $(INSTALL) -m 644
DIST_INSTALL_SCRIPT = CPPROG='cp -p' $(INSTALL) -m 755
itk_util.$(OBJEXT): $(GENERIC_DIR)/itk_util.c
$(COMPILE) -c `@CYGPATH@ $(GENERIC_DIR)/itk_util.c` -o $@
dist-clean:
rm -rf $(DIST_DIR) $(DIST_ROOT)/$(PKG_DIR).tar.*
dist: dist-clean $(srcdir)/manifest.uuid
$(INSTALL_DATA_DIR) $(DIST_DIR)
# TEA files
$(DIST_INSTALL_DATA) $(srcdir)/Makefile.in \
$(srcdir)/manifest.uuid $(DISTDIR) \
$(srcdir)/aclocal.m4 $(srcdir)/configure.ac \
$(DIST_DIR)/
$(DIST_INSTALL_SCRIPT) $(srcdir)/configure $(DIST_DIR)/
$(INSTALL_DATA_DIR) $(DIST_DIR)/tclconfig
$(DIST_INSTALL_DATA) $(srcdir)/tclconfig/README.txt \
$(srcdir)/tclconfig/tcl.m4 $(srcdir)/tclconfig/install-sh \
$(DIST_DIR)/tclconfig/
# Extension files
$(DIST_INSTALL_DATA) \
$(srcdir)/ChangeLog \
$(srcdir)/license.terms \
$(srcdir)/pkgIndex.tcl.in \
$(srcdir)/itkConfig.sh.in \
$(DIST_DIR)/
list='demos doc examples generic library tests win win/rc'; \
for p in $$list; do \
$(INSTALL_DATA_DIR) $(DIST_DIR)/$$p; \
for f in $(srcdir)/$$p/*; do \
if ! test -f $$f; then continue; fi; \
$(DIST_INSTALL_DATA) $$f $(DIST_DIR)/$$p/; \
done; \
done
(cd $(DIST_ROOT); $(COMPRESS);)
#========================================================================
# End of user-definable section
@@ -385,96 +361,99 @@ dist: dist-clean $(srcdir)/manifest.uuid
#========================================================================
# Don't modify the file to clean here. Instead, set the "CLEANFILES"
# variable in configure.ac
# variable in configure.in
#========================================================================
clean:
clean:
-test -z "$(BINARIES)" || rm -f $(BINARIES)
-rm -f *.$(OBJEXT) core *.core
-rm -f *.o core *.core
-rm -f *.$(OBJEXT)
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
-rm -f *.tab.c
-rm -f $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log config.status
-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.
# 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 tclsh shell)
# 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: binaries
@$(INSTALL_DATA_DIR) "$(DESTDIR)$(pkglibdir)"
install-lib-binaries: installdirs
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_LIBRARY) $$p $(DESTDIR)$(pkglibdir)/$$p"; \
$(INSTALL_LIBRARY) $$p "$(DESTDIR)$(pkglibdir)/$$p"; \
ext=`echo $$p|sed -e "s/.*\.//"`; \
if test "x$$ext" = "xdll"; then \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(bindir)/$$p; \
lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \
if test -f $$lib; then \
echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(pkglibdir)/$$lib"; \
$(INSTALL_DATA) $$lib "$(DESTDIR)$(pkglibdir)/$$lib"; \
echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \
$(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \
fi; \
else \
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p"; \
$(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/$$p; \
fi; \
fi; \
else :; fi; \
done
@list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
if test -f $(srcdir)/$$p; then \
destp=`basename $$p`; \
echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \
$(INSTALL_DATA) $(srcdir)/$$p "$(DESTDIR)$(pkglibdir)/$$destp"; \
fi; \
@list='$(lib_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(RANLIB) $(DESTDIR)$(bindir)/$$p"; \
$(RANLIB) $(DESTDIR)$(bindir)/$$p; \
else :; fi; \
done
@if test "x$(SHARED_BUILD)" = "x1"; then \
echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \
$(INSTALL_DATA) pkgIndex.tcl "$(DESTDIR)$(pkglibdir)"; \
fi
$(INSTALL_DATA) itkConfig.sh "$(DESTDIR)$(pkglibdir)"
$(INSTALL_DATA) pkgIndex.tcl $(pkglibdir)
#========================================================================
# Install binary executables (e.g. .exe files and dependent .dll files)
# This is for files that must go in the bin directory (located next to
# wish and tclsh), like dependent .dll files on Windows.
# Install binary executables (e.g. .exe files)
#
# You should not have to modify this target, except to define bin_BINARIES
# above if necessary.
# You should not have to modify this target.
#========================================================================
install-bin-binaries: binaries
@$(INSTALL_DATA_DIR) "$(DESTDIR)$(bindir)"
install-bin-binaries: installdirs
@list='$(bin_BINARIES)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \
$(INSTALL_PROGRAM) $$p "$(DESTDIR)$(bindir)/$$p"; \
fi; \
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:
list='$(lib_BINARIES)'; for p in $$list; do \
rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
done
list='$(PKG_TCL_SOURCES)'; for p in $$list; do \
p=`basename $$p`; \
rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
done
list='$(bin_BINARIES)'; for p in $$list; do \
rm -f "$(DESTDIR)$(bindir)/$$p"; \
@$(NORMAL_UNINSTALL)
list='$(BINARIES)'; for p in $$list; do \
rm -f $(DESTDIR)$(libdir)/$$p; \
done
.PHONY: all binaries clean depend distclean doc install libraries test
.PHONY: gdb gdb-test valgrind valgrindshell
.PHONY: genstubs
installdirs:
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(mkinstalldirs) $(DESTDIR)$(bindir)
$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
$(mkinstalldirs) $(ITK_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.
Vendored
+1 -9
View File
@@ -1,9 +1 @@
#
# Include the TEA standard macro set
#
builtin(include,tclconfig/tcl.m4)
#
# Add here whatever m4 macros you want to define for your package
#
builtin(include,../tcl.m4)
Vendored
+1686 -10339
View File
File diff suppressed because it is too large Load Diff
-262
View File
@@ -1,262 +0,0 @@
#!/bin/bash -norc
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#-----------------------------------------------------------------------
# Sample configure.ac for Tcl Extensions. The only places you should
# need to modify this file are marked by the string __CHANGE__
#-----------------------------------------------------------------------
#-----------------------------------------------------------------------
# __CHANGE__
# Set your package name and version numbers here.
#
# This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION
# set as provided. These will also be added as -D defs in your Makefile
# so you can encode the package version directly into the source files.
# This will also define a special symbol for Windows (BUILD_<PACKAGE_NAME>
# so that we create the export library with the dll.
#-----------------------------------------------------------------------
AC_INIT([itk], [4.2.3])
#--------------------------------------------------------------------
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
# This will define a ${TEA_PLATFORM} variable == "unix" or "windows"
# as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE.
#--------------------------------------------------------------------
TEA_INIT()
#--------------------------------------------------------------------
# Try to ensure the existence of a tclconfig directory in either
# $srcdir or the current dir, if one can't be found in $srcdir.
# If this package is being built as part of a bundle then a tclconfig
# directory might exist in $srcdir's parent directory.
#--------------------------------------------------------------------
AC_PROG_LN_S
CONFIG_CLEAN_FILES=
if test ! -d $srcdir/tclconfig ; then
if test -d $srcdir/../tclconfig ; then
$LN_S $srcdir/../tclconfig tclconfig
CONFIG_CLEAN_FILES=tclconfig
fi
fi
AC_SUBST(CONFIG_CLEAN_FILES)
#--------------------------------------------------------------------
# Tell autoconf where to find tcl.m4 and install.sh.
#--------------------------------------------------------------------
AC_CONFIG_AUX_DIR(tclconfig)
#--------------------------------------------------------------------
# Load the tclConfig.sh file
#--------------------------------------------------------------------
TEA_PATH_TCLCONFIG
TEA_LOAD_TCLCONFIG
#--------------------------------------------------------------------
# Load the tkConfig.sh file if necessary (Tk extension)
#--------------------------------------------------------------------
TEA_PATH_TKCONFIG
TEA_LOAD_TKCONFIG
#--------------------------------------------------------------------
# Load the itclConfig.sh file
#--------------------------------------------------------------------
TEA_PATH_CONFIG(itcl)
TEA_LOAD_CONFIG(itcl)
ITCL_INCLUDES="-I\"`${CYGPATH} ${itcl_SRC_DIR}/generic`\""
#-----------------------------------------------------------------------
# Handle the --prefix=... option by defaulting to what Tcl gave.
# Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER.
#-----------------------------------------------------------------------
TEA_PREFIX
#-----------------------------------------------------------------------
# Standard compiler checks.
# This sets up CC by using the CC env var, or looks for gcc otherwise.
# This also calls AC_PROG_CC and a few others to create the basic setup
# necessary to compile executables.
#-----------------------------------------------------------------------
TEA_SETUP_COMPILER
#-----------------------------------------------------------------------
# __CHANGE__
# Specify the C source files to compile in TEA_ADD_SOURCES,
# public headers that need to be installed in TEA_ADD_HEADERS,
# stub library C source files to compile in TEA_ADD_STUB_SOURCES,
# and runtime Tcl library files in TEA_ADD_TCL_SOURCES.
# This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS
# and PKG_TCL_SOURCES.
#-----------------------------------------------------------------------
TEA_ADD_SOURCES([
itkArchBase.c
itkArchetype.c
itkBase.c
itkCmd.c
itkHelpers.c
itkOption.c
itkUtil.c
itkStubInit.c
])
TEA_ADD_HEADERS([generic/itk.h generic/itkInt.h])
TEA_ADD_INCLUDES([${ITCL_INCLUDES} -I\"`${CYGPATH} ${srcdir}/generic`\"])
TEA_ADD_LIBS([])
TEA_ADD_CFLAGS([])
#TEA_ADD_STUB_SOURCES([itkStubLib.c])
TEA_ADD_TCL_SOURCES([library/Archetype.itk
library/Toplevel.itk
library/Widget.itk
library/itk.tcl
library/tclIndex])
#--------------------------------------------------------------------
# __CHANGE__
#
# You can add more files to clean if your extension creates any extra
# files by extending CLEANFILES.
# Add pkgIndex.tcl if it is generated in the Makefile instead of ./configure
# and change Makefile.in to move it from CONFIG_CLEAN_FILES to BINARIES var.
#
# A few miscellaneous platform-specific items:
# TEA_ADD_* any platform specific compiler/build info here.
#--------------------------------------------------------------------
#CLEANFILES="$CLEANFILES pkgIndex.tcl"
if test "${TEA_PLATFORM}" = "windows" ; then
# Ensure no empty if clauses
:
#TEA_ADD_SOURCES([win/winFile.c])
#TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"])
TEA_ADD_SOURCES([dllEntryPoint.c])
else
# Ensure no empty else clauses
:
#TEA_ADD_SOURCES([unix/unixFile.c])
#TEA_ADD_LIBS([-lsuperfly])
fi
#--------------------------------------------------------------------
# __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 called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG
#--------------------------------------------------------------------
#TEA_PUBLIC_TCL_HEADERS
TEA_PRIVATE_TCL_HEADERS
TEA_PUBLIC_TK_HEADERS
#TEA_PRIVATE_TK_HEADERS
TEA_PATH_X
#--------------------------------------------------------------------
# We need to enable the threading macros found in tcl.h and tclInt.h.
# The use of the threading features is determined by the core the
# extension is loaded into, but we need to compile with these macros
# turned on.
#--------------------------------------------------------------------
AC_DEFINE(TCL_THREADS)
#--------------------------------------------------------------------
# Check whether --enable-threads or --disable-threads was given.
# This auto-enables if Tcl was compiled threaded.
#--------------------------------------------------------------------
#TEA_ENABLE_THREADS
#--------------------------------------------------------------------
# The statement below defines a collection of symbols related to
# building as a shared library instead of a static library.
#--------------------------------------------------------------------
TEA_ENABLE_SHARED
#--------------------------------------------------------------------
# This macro figures out what flags to use with the compiler/linker
# when building shared/static debug/optimized objects. This information
# can be taken from the tclConfig.sh file, but this figures it all out.
#--------------------------------------------------------------------
TEA_CONFIG_CFLAGS
#--------------------------------------------------------------------
# Set the default compiler switches based on the --enable-symbols option.
#--------------------------------------------------------------------
TEA_ENABLE_SYMBOLS
#--------------------------------------------------------------------
# Itcl stubs
#--------------------------------------------------------------------
if test "${SHARED_BUILD}" = "1" ; then
AC_DEFINE(USE_ITCL_STUBS)
fi
#--------------------------------------------------------------------
# This macro generates a line to use when building a library. It
# depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS,
# and TEA_LOAD_TCLCONFIG macros above.
#--------------------------------------------------------------------
TEA_MAKE_LIB
#--------------------------------------------------------------------
# Determine the name of the tclsh and/or wish executables in the
# Tcl and Tk build directories or the location they were installed
# into. These paths are used to support running test cases only,
# the Makefile should not be making use of these paths to generate
# a pkgIndex.tcl file or anything else at extension build time.
#--------------------------------------------------------------------
TEA_PROG_TCLSH
TEA_PROG_WISH
#--------------------------------------------------------------------
# Setup a *Config.sh.in configuration file.
#--------------------------------------------------------------------
# itk_SRC_DIR must be a fully qualified path
eval itk_SRC_DIR="$srcdir"
itk_SRC_DIR="`(cd "${itk_SRC_DIR}"; pwd)`"
itk_LIB_FILE="${PKG_LIB_FILE}"
itk_STUB_LIB_FILE="${PKG_STUB_LIB_FILE}"
TEA_EXPORT_CONFIG([itk])
AC_SUBST(ITCL_VERSION)
AC_SUBST(itk_SRC_DIR)
AC_SUBST(itk_LIB_FILE)
AC_SUBST(itk_STUB_LIB_FILE)
#--------------------------------------------------------------------
# Specify files to substitute AC variables in. You may alternatively
# have a special pkgIndex.tcl.in or other files which require
# substituting the AC variables in. Include these here.
#--------------------------------------------------------------------
AC_CONFIG_FILES([Makefile pkgIndex.tcl])
AC_CONFIG_FILES([itkConfig.sh])
#--------------------------------------------------------------------
# Finally, substitute all of the various values into the files
# specified with AC_CONFIG_FILES.
#--------------------------------------------------------------------
AC_OUTPUT()
+358
View File
@@ -0,0 +1,358 @@
#--------------------------------------------------------------------
# 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/itk.h)
AC_CONFIG_AUX_DIR(../config)
#--------------------------------------------------------------------
# __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=itk
MAJOR_VERSION=3
MINOR_VERSION=1
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}")
#--------------------------------------------------------------------
# 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.
#--------------------------------------------------------------------
SC_ENABLE_GCC
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
#--------------------------------------------------------------------
case "`uname -s`" in
*win32* | *WIN32* | *CYGWIN_NT*)
CYGPATH="cygpath -w"
RELPATH=".. .. bin"
;;
*)
CYGPATH=echo
RELPATH=..
;;
esac
AC_SUBST(CYGPATH)
AC_SUBST(RELPATH)
#--------------------------------------------------------------------
# Includes for this package
#--------------------------------------------------------------------
ITK_GENERIC_DIR_NATIVE=`${CYGPATH} ${srcdir}/generic`
ITK_WIN_DIR_NATIVE=`${CYGPATH} ${srcdir}/win`
ITK_UNIX_DIR_NATIVE=`${CYGPATH} ${srcdir}/unix`
case "`uname -s`" in
*win32* | *WIN32* | *CYGWIN_NT*)
ITK_PLATFORM_DIR_NATIVE=${ITK_WIN_DIR_NATIVE}
;;
*)
ITK_PLATFORM_DIR_NATIVE=${ITK_UNIX_DIR_NATIVE}
;;
esac
ITK_INCLUDES="-I\"${ITK_GENERIC_DIR_NATIVE}\" -I\"${ITK_PLATFORM_DIR_NATIVE}\""
AC_SUBST(ITK_GENERIC_DIR_NATIVE)
AC_SUBST(ITK_WIN_DIR_NATIVE)
AC_SUBST(ITK_UNIX_DIR_NATIVE)
AC_SUBST(ITK_INCLUDES)
#--------------------------------------------------------------------
# Load the tclConfig.sh file
#--------------------------------------------------------------------
SC_PATH_TCLCONFIG
SC_LOAD_TCLCONFIG
#--------------------------------------------------------------------
# Load the tkConfig.sh file
#--------------------------------------------------------------------
SC_PATH_TKCONFIG
SC_LOAD_TKCONFIG
AC_ARG_WITH(itcl, [ --with-itclinclude=DIR use Itcl headers from DIR],
ITCL_LIB_DIR=$withval, ITCL_LIB_DIR=`cd ${srcdir}/../itcl; pwd`)
if test ! -r "${ITCL_LIB_DIR}/generic/itclInt.h" ; then
AC_MSG_ERROR(Can't find Itcl private header files. Use --with-itclinclude to specify the directory containing the Itcl private headers on your system.)
fi
ITCL_INCLUDES=-I\"`${CYGPATH} ${ITCL_LIB_DIR}/generic`\"
AC_SUBST(ITCL_INCLUDES)
#--------------------------------------------------------------------
# The value for this should have been cached during the Itcl configuration.
# Make sure the cache-ID that appears here is the same as the one that
# appears in the Itcl configure script.
#--------------------------------------------------------------------
AC_MSG_CHECKING(for name if Itcl stub library)
AC_CACHE_VAL(ac_cv_itclstub_LIB_FILE, ac_cv_itclstub_LIB_FILE="NONE")
if test x"${ac_cv_itclstub_LIB_FILE}" = x"NONE" ; then
AC_MSG_ERROR(Can't find name of Itcl stub library. How did this happen?)
else
AC_MSG_RESULT(${ac_cv_itclstub_LIB_FILE})
fi
itclstub_LIB_FILE=${ac_cv_itclstub_LIB_FILE}
AC_SUBST(itclstub_LIB_FILE)
SC_LIB_SPEC(tkstub, ${TK_BIN_DIR})
AC_SUBST(tkstub_LIB_SPEC)
#--------------------------------------------------------------------
# __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
#SC_PUBLIC_TK_HEADERS
SC_PRIVATE_TK_HEADERS
#--------------------------------------------------------------------
# __CHANGE__
# A few miscellaneous platform-specific items:
#
# Define a special symbol for Windows (BUILD_itk 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 "`uname -s`" in
*win32* | *WIN32* | *CYGWIN_NT*)
AC_DEFINE_UNQUOTED(BUILD_${PACKAGE})
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.
#--------------------------------------------------------------------
AC_DEFINE(USE_TCL_STUBS)
AC_DEFINE(USE_TK_STUBS)
AC_DEFINE(USE_ITCL_STUBS)
#--------------------------------------------------------------------
# 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.
#--------------------------------------------------------------------
case "`uname -s`" in
*win32* | *WIN32* | *CYGWIN_NT*)
if test "${SHARED_BUILD}" = "1" ; then
SHLIB_LD_LIBS="\"`cygpath -w ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\" ${TCL_SHLIB_LD_LIBS} \"`${CYGPATH} ../itcl/${itclstub_LIB_FILE}`\" ${tkstub_LIB_SPEC} "
eval "${PACKAGE}_LIB_FILE=${PACKAGE}${SHARED_LIB_SUFFIX}"
RANLIB=:
else
eval "${PACKAGE}_LIB_FILE=${PACKAGE}${UNSHARED_LIB_SUFFIX}"
fi
eval "${PACKAGE}stub_LIB_FILE=${PACKAGE}stub${UNSHARED_LIB_SUFFIX}"
;;
*)
if test "${SHARED_BUILD}" = "1" ; then
SHLIB_LD_LIBS="${TCL_STUB_LIB_SPEC} ${tkstub_LIB_SPEC} ../itcl/${itclstub_LIB_FILE}"
eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${SHARED_LIB_SUFFIX}"
RANLIB=:
else
eval "${PACKAGE}_LIB_FILE=lib${PACKAGE}${UNSHARED_LIB_SUFFIX}"
fi
eval "${PACKAGE}stub_LIB_FILE=lib${PACKAGE}stub${UNSHARED_LIB_SUFFIX}"
;;
esac
#--------------------------------------------------------------------
# __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(itkstub_LIB_FILE)
AC_SUBST(itk_LIB_FILE)
AC_SUBST(SHLIB_LD_LIBS)
#--------------------------------------------------------------------
# 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.
#--------------------------------------------------------------------
SC_PROG_TCLSH
#--------------------------------------------------------------------
# Finally, substitute all of the various values into the Makefile.
#--------------------------------------------------------------------
AC_OUTPUT([Makefile \
pkgIndex.tcl])
+8 -10
View File
@@ -1,13 +1,13 @@
#!/bin/sh
#\
exec wish8.4 "$0"
exec itkwish $0
# ======================================================================
# Simple text editor built with [incr Widgets]
# ----------------------------------------------------------------------
# AUTHOR: Michael J. McLennan
# CLASS: Object-Oriented Programming with [incr Tcl]
# ======================================================================
package require Iwidgets 4.0
package require Iwidgets 2.1
option add *edit.width 5i startupFile
option add *edit.height 4i startupFile
@@ -20,24 +20,24 @@ set FileWindows 0
# ----------------------------------------------------------------------
# Dialog boxes
# ----------------------------------------------------------------------
iwidgets::messagedialog .notice -title "itkedit: Notice" \
messagedialog .notice -title "itkedit: Notice" \
-bitmap info -buttonboxpos e -modality application
.notice hide OK
.notice hide Help
.notice buttonconfigure Cancel -text "Dismiss"
iwidgets::messagedialog .confirm -title "itkedit: Confirm" \
messagedialog .confirm -title "itkedit: Confirm" \
-bitmap questhead -modality application
.confirm hide Help
.confirm buttonconfigure OK -text "Yes"
.confirm buttonconfigure Cancel -text "No"
iwidgets::fileselectiondialog .files -title "itkedit: Files" \
fileselectiondialog .files -title "itkedit: Files" \
-childsitepos s -modality application
.files hide Help
set PaneMenu "[.files childsite].panes"
iwidgets::optionmenu $PaneMenu -labeltext "Edit Window:"
optionmenu $PaneMenu -labeltext "Edit Window:"
pack $PaneMenu -pady 6
# ----------------------------------------------------------------------
@@ -168,7 +168,7 @@ proc split_view {} {
set FileName($win) untitled.txt
set FileChanged($win) 0
iwidgets::scrolledtext $win.text -wrap none -labeltext "file: $FileName($win)" \
scrolledtext $win.text -wrap none -labeltext "file: $FileName($win)" \
-hscrollmode none -vscrollmode dynamic -visibleitems 1x1
pack $win.text -expand yes -fill both
@@ -213,7 +213,7 @@ menu .mbar.view.menu
# ----------------------------------------------------------------------
# Editor
# ----------------------------------------------------------------------
iwidgets::panedwindow .edit -orient horizontal
panedwindow .edit -orient horizontal
pack .edit -expand yes -fill both
split_view
@@ -225,5 +225,3 @@ after idle {
update idletasks
wm minsize . [winfo reqwidth .] [winfo reqheight .]
}
+8 -6
View File
@@ -4,6 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id: Archetype.n,v 1.1 1998/07/27 18:45:35 stanton Exp $
'\"
.so man.macros
.TH Archetype n 3.0 itk "[incr\ Tk]"
.BS
@@ -190,7 +192,7 @@ override settings determined from the X11 resource database.
The arguments to the constructor are usually passed along
to this method as follows:
.CS
itcl::class MyWidget {
class MyWidget {
inherit Widget
constructor {args} {
@@ -228,7 +230,7 @@ for their "hull" component: -background and -cursor. A derived
class can override this decision, and add options that control
the border of the "hull" component as well:
.CS
itcl::class MyWidget {
class MyWidget {
inherit Widget
constructor {args} {
@@ -265,7 +267,7 @@ new value is reported to standard output. Note that this synthetic
option is integrated with the rest of the "-background" options
that have been kept from component widgets:
.CS
itcl::class MyWidget {
class MyWidget {
inherit Widget
constructor {args} {
itk_component add label {
@@ -293,8 +295,8 @@ used to remove options at a later time. For example, a derived
class can override an option defined in a base class by removing
and redefining the option:
.CS
itcl::class Base {
inherit itk::Widget
class Base {
inherit Widget
constructor {args} {
eval itk_initialize $args
}
@@ -304,7 +306,7 @@ itcl::class Base {
}
}
itcl::class Derived {
class Derived {
inherit Base
constructor {args} {
+4 -2
View File
@@ -4,6 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id: Toplevel.n,v 1.3 1998/08/11 14:40:53 welch Exp $
'\"
.so man.macros
.TH Toplevel n 3.0 itk "[incr\ Tk]"
.BS
@@ -66,7 +68,7 @@ user can dismiss by pushing the "Dismiss" button.
.CS
option add *MessageInfo.title "Notice" widgetDefault
itcl::class MessageInfo {
class MessageInfo {
inherit itk::Toplevel
constructor {args} {
@@ -115,7 +117,7 @@ itcl::class MessageInfo {
}
}
itk::usual MessageInfo {
usual MessageInfo {
keep -background -cursor -foreground -font
keep -activebackground -activeforeground -disabledforeground
keep -highlightcolor -highlightthickness
+6 -4
View File
@@ -4,6 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id: Widget.n,v 1.1 1998/07/27 18:45:36 stanton Exp $
'\"
.so man.macros
.TH Widget n 3.0 itk "[incr\ Tk]"
.BS
@@ -58,7 +60,7 @@ option add *TextDisplay.textBackground ivory widgetDefault
option add *TextDisplay.width 40 widgetDefault
option add *TextDisplay.height 10 widgetDefault
itcl::class TextDisplay {
class TextDisplay {
inherit itk::Widget
constructor {args} {
@@ -85,20 +87,20 @@ itcl::class TextDisplay {
public method append {info}
}
itcl::body TextDisplay::display {info} {
body TextDisplay::display {info} {
$itk_component(text) configure -state normal
$itk_component(text) delete 1.0 end
$itk_component(text) insert 1.0 $info
$itk_component(text) configure -state disabled
}
itcl::body TextDisplay::append {info} {
body TextDisplay::append {info} {
$itk_component(text) configure -state normal
$itk_component(text) insert end $info
$itk_component(text) configure -state disabled
}
itk::usual TextDisplay {
usual TextDisplay {
keep -background -cursor -foreground -font
keep -activebackground -activerelief
keep -highlightcolor -highlightthickness
+2
View File
@@ -4,6 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id: itk.n,v 1.1 1998/07/27 18:45:36 stanton Exp $
'\"
.so man.macros
.TH itk n 3.0 itk "[incr\ Tk]"
.BS
+2
View File
@@ -4,6 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id: itkvars.n,v 1.1 1998/07/27 18:45:37 stanton Exp $
'\"
.so man.macros
.TH itkvars n 3.0 itk "[incr\ Tk]"
.BS
+55
View File
@@ -0,0 +1,55 @@
'\"
'\" 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.
'\"
'\" RCS: $Id: itkwish.1,v 1.1 1998/07/27 18:45:37 stanton Exp $
'\"
.so man.macros
.TH itkwish 1 3.0 itk "[incr\ Tk]"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
itkwish \- Simple windowing shell for [incr\ Tcl] / [incr\ Tk]
.SH SYNOPSIS
\fBitkwish\fR ?\fIfileName arg arg ...\fR?
.SH OPTIONS
.IP "\fB\-display \fIdisplay\fR" 20
Display (and screen) on which to display window.
.IP "\fB\-geometry \fIgeometry\fR" 20
Initial geometry to use for window. If this option is specified, its
value is stored in the \fBgeometry\fR global variable of the application's
Tcl interpreter.
.IP "\fB\-name \fIname\fR" 20
Use \fIname\fR as the title to be displayed in the window, and
as the name of the interpreter for \fBsend\fR commands.
.IP "\fB\-sync\fR" 20
Execute all X server commands synchronously, so that errors
are reported immediately. This will result in much slower
execution, but it is useful for debugging.
.IP "\fB\-\|\-\fR" 20
Pass all remaining arguments through to the script's \fBargv\fR
variable without interpreting them.
This provides a mechanism for passing arguments such as \fB\-name\fR
to a script instead of having \fBitkwish\fR interpret them.
.BE
.SH DESCRIPTION
.PP
\fBitkwish\fR is a simple program consisting of the Tcl command
language, the Tk toolkit, the \fB[incr\ Tcl]\fR extension for
object-oriented programming, and the \fB[incr\ Tk]\fR extension
for building mega-widgets. The main program creates an
interpreter, creates a main window, and then processes Tcl
commands from standard input or from a file.
.PP
\fBitkwish\fR is just like \fBwish\fR, but includes the
\fB[incr\ Tcl]\fR / \fB[incr\ Tk]\fR extensions.
.PP
See the \fBwish\fR man page for details concerning usage. See
the \fBitcl\fR and \fBitk\fR man pages for an overview of
\fB[incr\ Tcl]\fR / \fB[incr\ Tk]\fR.
.SH KEYWORDS
Tcl, Tk, itcl, itk, interpreter, shell, toolkit
+88 -119
View File
@@ -1,86 +1,80 @@
.\" The -*- nroff -*- definitions below are for supplemental macros used
.\" in Tcl/Tk manual entries.
.\"
.\" .AP type name in/out ?indent?
.\" Start paragraph describing an argument to a library procedure.
.\" type is type of argument (int, etc.), in/out is either "in", "out",
.\" or "in/out" to describe whether procedure reads or modifies arg,
.\" and indent is equivalent to second arg of .IP (shouldn't ever be
.\" needed; use .AS below instead)
.\"
.\" .AS ?type? ?name?
.\" Give maximum sizes of arguments for setting tab stops. Type and
.\" name are examples of largest possible arguments that will be passed
.\" to .AP later. If args are omitted, default tab stops are used.
.\"
.\" .BS
.\" Start box enclosure. From here until next .BE, everything will be
.\" enclosed in one large box.
.\"
.\" .BE
.\" End of box enclosure.
.\"
.\" .CS
.\" Begin code excerpt.
.\"
.\" .CE
.\" End code excerpt.
.\"
.\" .VS ?version? ?br?
.\" Begin vertical sidebar, for use in marking newly-changed parts
.\" of man pages. The first argument is ignored and used for recording
.\" the version when the .VS was added, so that the sidebars can be
.\" found and removed when they reach a certain age. If another argument
.\" is present, then a line break is forced before starting the sidebar.
.\"
.\" .VE
.\" End of vertical sidebar.
.\"
.\" .DS
.\" Begin an indented unfilled display.
.\"
.\" .DE
.\" End of indented unfilled display.
.\"
.\" .SO ?manpage?
.\" Start of list of standard options for a Tk widget. The manpage
.\" argument defines where to look up the standard options; if
.\" omitted, defaults to "options". The options follow on successive
.\" lines, in three columns separated by tabs.
.\"
.\" .SE
.\" End of list of standard options for a Tk widget.
.\"
.\" .OP cmdName dbName dbClass
.\" Start of description of a specific option. cmdName gives the
.\" option's name as specified in the class command, dbName gives
.\" the option's name in the option database, and dbClass gives
.\" the option's class in the option database.
.\"
.\" .UL arg1 arg2
.\" Print arg1 underlined, then print arg2 normally.
.\"
.\" .QW arg1 ?arg2?
.\" Print arg1 in quotes, then arg2 normally (for trailing punctuation).
.\"
.\" .PQ arg1 ?arg2?
.\" Print an open parenthesis, arg1 in quotes, then arg2 normally
.\" (for trailing punctuation) and then a closing parenthesis.
.\"
.\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
'\" The definitions below are for supplemental macros used in Tcl/Tk
'\" manual entries.
'\"
'\" .AP type name in/out ?indent?
'\" Start paragraph describing an argument to a library procedure.
'\" type is type of argument (int, etc.), in/out is either "in", "out",
'\" or "in/out" to describe whether procedure reads or modifies arg,
'\" and indent is equivalent to second arg of .IP (shouldn't ever be
'\" needed; use .AS below instead)
'\"
'\" .AS ?type? ?name?
'\" Give maximum sizes of arguments for setting tab stops. Type and
'\" name are examples of largest possible arguments that will be passed
'\" to .AP later. If args are omitted, default tab stops are used.
'\"
'\" .BS
'\" Start box enclosure. From here until next .BE, everything will be
'\" enclosed in one large box.
'\"
'\" .BE
'\" End of box enclosure.
'\"
'\" .CS
'\" Begin code excerpt.
'\"
'\" .CE
'\" End code excerpt.
'\"
'\" .VS ?version? ?br?
'\" Begin vertical sidebar, for use in marking newly-changed parts
'\" of man pages. The first argument is ignored and used for recording
'\" the version when the .VS was added, so that the sidebars can be
'\" found and removed when they reach a certain age. If another argument
'\" is present, then a line break is forced before starting the sidebar.
'\"
'\" .VE
'\" End of vertical sidebar.
'\"
'\" .DS
'\" Begin an indented unfilled display.
'\"
'\" .DE
'\" End of indented unfilled display.
'\"
'\" .SO
'\" Start of list of standard options for a Tk widget. The
'\" options follow on successive lines, in four columns separated
'\" by tabs.
'\"
'\" .SE
'\" End of list of standard options for a Tk widget.
'\"
'\" .OP cmdName dbName dbClass
'\" Start of description of a specific option. cmdName gives the
'\" option's name as specified in the class command, dbName gives
'\" the option's name in the option database, and dbClass gives
'\" the option's class in the option database.
'\"
'\" .UL arg1 arg2
'\" Print arg1 underlined, then print arg2 normally.
'\"
'\" SCCS: @(#) man.macros 1.9 97/08/22 18:50:59
'\"
'\" # Set up traps and other miscellaneous stuff for Tcl/Tk man pages.
.if t .wh -1.3i ^B
.nr ^l \n(.l
.ad b
.\" # Start an argument description
'\" # Start an argument description
.de AP
.ie !"\\$4"" .TP \\$4
.el \{\
. ie !"\\$2"" .TP \\n()Cu
. el .TP 15
.\}
.ta \\n()Au \\n()Bu
.ie !"\\$3"" \{\
\&\\$1 \\fI\\$2\\fP (\\$3)
.ta \\n()Au \\n()Bu
\&\\$1 \\fI\\$2\\fP (\\$3)
.\".b
.\}
.el \{\
@@ -93,7 +87,7 @@
.\}
.\}
..
.\" # define tabbing values for .AP
'\" # define tabbing values for .AP
.de AS
.nr )A 10n
.if !"\\$1"" .nr )A \\w'\\$1'u+3n
@@ -103,9 +97,9 @@
.nr )C \\n()Bu+\\w'(in/out)'u+2n
..
.AS Tcl_Interp Tcl_CreateInterp in/out
.\" # BS - start boxed text
.\" # ^y = starting y location
.\" # ^b = 1
'\" # BS - start boxed text
'\" # ^y = starting y location
'\" # ^b = 1
.de BS
.br
.mk ^y
@@ -115,7 +109,7 @@
.if n \l'\\n(.lu\(ul'
.if n .fi
..
.\" # BE - end boxed text (draw box now)
'\" # BE - end boxed text (draw box now)
.de BE
.nf
.ti 0
@@ -135,16 +129,16 @@
.br
.nr ^b 0
..
.\" # VS - start vertical sidebar
.\" # ^Y = starting y location
.\" # ^v = 1 (for troff; for nroff this doesn't matter)
'\" # VS - start vertical sidebar
'\" # ^Y = starting y location
'\" # ^v = 1 (for troff; for nroff this doesn't matter)
.de VS
.if !"\\$2"" .br
.mk ^Y
.ie n 'mc \s12\(br\s0
.el .nr ^v 1u
..
.\" # VE - end of vertical sidebar
'\" # VE - end of vertical sidebar
.de VE
.ie n 'mc
.el \{\
@@ -159,9 +153,9 @@
.\}
.nr ^v 0
..
.\" # Special macro to handle page bottom: finish off current
.\" # box/sidebar if in box/sidebar mode, then invoked standard
.\" # page bottom macro.
'\" # Special macro to handle page bottom: finish off current
'\" # box/sidebar if in box/sidebar mode, then invoked standard
'\" # page bottom macro.
.de ^B
.ev 2
'ti 0
@@ -188,36 +182,34 @@
.mk ^Y
.\}
..
.\" # DS - begin display
'\" # DS - begin display
.de DS
.RS
.nf
.sp
..
.\" # DE - end display
'\" # DE - end display
.de DE
.fi
.RE
.sp
..
.\" # SO - start of list of standard options
'\" # SO - start of list of standard options
.de SO
'ie '\\$1'' .ds So \\fBoptions\\fR
'el .ds So \\fB\\$1\\fR
.SH "STANDARD OPTIONS"
.LP
.nf
.ta 5.5c 11c
.ta 4c 8c 12c
.ft B
..
.\" # SE - end of list of standard options
'\" # SE - end of list of standard options
.de SE
.fi
.ft R
.LP
See the \\*(So manual entry for details on the standard options.
See the \\fBoptions\\fR manual entry for details on the standard options.
..
.\" # OP - start of full description for a single option
'\" # OP - start of full description for a single option
.de OP
.LP
.nf
@@ -228,40 +220,17 @@ Database Class: \\fB\\$3\\fR
.fi
.IP
..
.\" # CS - begin code excerpt
'\" # CS - begin code excerpt
.de CS
.RS
.nf
.ta .25i .5i .75i 1i
..
.\" # CE - end code excerpt
'\" # CE - end code excerpt
.de CE
.fi
.RE
..
.\" # UL - underline word
.de UL
\\$1\l'|0\(ul'\\$2
..
.\" # QW - apply quotation marks to word
.de QW
.ie '\\*(lq'"' ``\\$1''\\$2
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\$2
..
.\" # PQ - apply parens and quotation marks to word
.de PQ
.ie '\\*(lq'"' (``\\$1''\\$2)\\$3
.\"" fix emacs highlighting
.el (\\*(lq\\$1\\*(rq\\$2)\\$3
..
.\" # QR - quoted range
.de QR
.ie '\\*(lq'"' ``\\$1''\\-``\\$2''\\$3
.\"" fix emacs highlighting
.el \\*(lq\\$1\\*(rq\\-\\*(lq\\$2\\*(rq\\$3
..
.\" # MT - "empty" string
.de MT
.QW ""
..
+3 -1
View File
@@ -4,6 +4,8 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: $Id: usual.n,v 1.1 1998/07/27 18:45:40 stanton Exp $
'\"
.so man.macros
.TH usual n 3.0 itk "[incr\ Tk]"
.BS
@@ -59,7 +61,7 @@ all \fItag\fR names previously registered.
Following is the \fBusual\fR declaration for the standard
Tk button widget:
.CS
itk::usual Button {
usual Button {
keep -background -cursor -foreground -font
keep -activebackground -activeforeground -disabledforeground
keep -highlightcolor -highlightthickness
+65 -75
View File
@@ -1,20 +1,18 @@
# -*- tcl -*-
# itk.decls --
#
# This file contains the declarations for all supported public
# functions that are exported by the Itk library via the stubs table.
# This file is used to generate the itkDecls.h file.
#
#
# 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:
# public API
library itk
interface itk
hooks {itkInt}
epoch 0
scspec ITKAPI
# Declare each of the functions in the public Itk interface. Note that
# the an index should never be reused for a different function in order
@@ -25,11 +23,64 @@ scspec ITKAPI
# Exported functions:
#
declare 0 {
declare 0 generic {
int Itk_Init (Tcl_Interp *interp)
}
declare 1 {
int Itk_SafeInit (Tcl_Interp *interp)
#declare 1 generic {
# int Itk_SafeInit (Tcl_Interp *interp)
#}
#
# Functions used internally by this package:
#
declare 2 generic {
int Itk_ConfigBodyCmd (ClientData cdata, Tcl_Interp *interp, \
int objc, Tcl_Obj *CONST objv[])
}
declare 3 generic {
int Itk_UsualCmd (ClientData cdata, Tcl_Interp *interp, int objc, \
Tcl_Obj *CONST objv[])
}
#
# Functions for managing options included in class definitions:
#
declare 4 generic {
int Itk_ClassOptionDefineCmd (ClientData cdata, Tcl_Interp *interp, \
int objc, Tcl_Obj *CONST objv[])
}
declare 5 generic {
int Itk_ClassOptionIllegalCmd (ClientData cdata, Tcl_Interp *interp, \
int objc, Tcl_Obj *CONST objv[])
}
declare 6 generic {
int Itk_ConfigClassOption (Tcl_Interp *interp, ItclObject *contextObj, \
ClientData cdata, char* newVal)
}
declare 7 generic {
ItkClassOptTable* Itk_CreateClassOptTable( Tcl_Interp *interp, \
ItclClass *cdefn)
}
declare 8 generic {
ItkClassOptTable* Itk_FindClassOptTable (ItclClass *cdefn)
}
#declare 9 generic {
# void Itk_DeleteClassOptTable (Tcl_Interp *interp, ItclClass *cdefn)
#}
declare 10 generic {
int Itk_CreateClassOption (Tcl_Interp *interp, ItclClass *cdefn, \
char *switchName, char *resName, char *resClass, char *defVal, \
char *config, ItkClassOption **optPtr)
}
declare 11 generic {
ItkClassOption* Itk_FindClassOption (ItclClass *cdefn, char *switchName)
}
declare 12 generic {
void Itk_DelClassOption (ItkClassOption *opt)
}
@@ -37,85 +88,24 @@ declare 1 {
# Functions needed for the Archetype base class:
#
declare 13 {
declare 13 generic {
int Itk_ArchetypeInit (Tcl_Interp* interp)
}
# private API
interface itkInt
#
# Functions used within the package, but not considered "public"
#
#
# Functions used internally by this package:
#
declare 2 {
int Itk_ConfigBodyCmd (ClientData cdata, Tcl_Interp *interp, \
int objc, Tcl_Obj *const objv[])
}
declare 3 {
int Itk_UsualCmd (ClientData cdata, Tcl_Interp *interp, int objc, \
Tcl_Obj *const objv[])
}
#
# Functions for managing options included in class definitions:
#
declare 4 {
int Itk_ClassOptionDefineCmd (ClientData cdata, Tcl_Interp *interp, \
int objc, Tcl_Obj *const objv[])
}
declare 5 {
int Itk_ClassOptionIllegalCmd (ClientData cdata, Tcl_Interp *interp, \
int objc, Tcl_Obj *const objv[])
}
declare 6 {
int Itk_ConfigClassOption (Tcl_Interp *interp, ItclObject *contextObj, \
ClientData cdata, const char* newVal)
}
declare 7 {
ItkClassOptTable* Itk_CreateClassOptTable( Tcl_Interp *interp, \
ItclClass *cdefn)
}
declare 8 {
ItkClassOptTable* Itk_FindClassOptTable (ItclClass *cdefn)
}
#declare 9 {
# void Itk_DeleteClassOptTable (Tcl_Interp *interp, ItclClass *cdefn)
#}
declare 10 {
int Itk_CreateClassOption (Tcl_Interp *interp, ItclClass *cdefn, \
char *switchName, char *resName, char *resClass, char *defVal, \
char *config, ItkClassOption **optPtr)
}
declare 11 {
ItkClassOption* Itk_FindClassOption (ItclClass *cdefn, const char *switchName)
}
declare 12 {
void Itk_DelClassOption (ItkClassOption *opt)
}
#
# Functions for maintaining the ordered option list:
#
declare 14 {
declare 14 generic {
void Itk_OptListInit (ItkOptList* olist, Tcl_HashTable *options)
}
declare 15 {
declare 15 generic {
void Itk_OptListFree (ItkOptList* olist)
}
declare 16 {
declare 16 generic {
void Itk_OptListAdd (ItkOptList* olist, Tcl_HashEntry *entry)
}
declare 17 {
declare 17 generic {
void Itk_OptListRemove (ItkOptList* olist, Tcl_HashEntry *entry)
}
+34 -54
View File
@@ -37,6 +37,8 @@
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
*
* RCS: $Id: itk.h,v 1.5 1999/05/24 21:10:47 redman Exp $
* ========================================================================
* Copyright (c) 1993-1998 Lucent Technologies, Inc.
* ------------------------------------------------------------------------
@@ -46,34 +48,6 @@
#ifndef ITK_H
#define ITK_H
#if defined(BUILD_itk)
# define ITKAPI DLLEXPORT
# undef USE_ITK_STUBS
# undef USE_ITCL_STUBS
#else
# define ITKAPI DLLIMPORT
#endif
#ifndef TCL_ALPHA_RELEASE
# define TCL_ALPHA_RELEASE 0
#endif
#ifndef TCL_BETA_RELEASE
# define TCL_BETA_RELEASE 1
#endif
#ifndef TCL_FINAL_RELEASE
# define TCL_FINAL_RELEASE 2
#endif
#define ITK_MAJOR_VERSION 4
#define ITK_MINOR_VERSION 2
#define ITK_RELEASE_LEVEL TCL_FINAL_RELEASE
#define ITK_RELEASE_SERIAL 3
#define ITK_VERSION "4.2"
#define ITK_PATCH_LEVEL "4.2.3"
/*
* A special definition used to allow this header file to be included
* in resource files so that they can get obtain version information from
@@ -81,42 +55,48 @@
* and procedure declarations, that occur below.
*/
#ifndef RC_INVOKED
#ifndef RESOURCE_INCLUDED
#include <tk.h>
#include "itclInt.h"
#include "tk.h"
#undef TCL_STORAGE_CLASS
#ifdef BUILD_itk
# define TCL_STORAGE_CLASS DLLEXPORT
#else
# ifdef USE_ITK_STUBS
# define TCL_STORAGE_CLASS
# else
# define TCL_STORAGE_CLASS DLLIMPORT
# endif
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLEXPORT
#endif
/*
* This function is contained in the itkstub static library
* List of options in alphabetical order:
*/
typedef struct ItkOptList {
Tcl_HashTable *options; /* list containing the real options */
Tcl_HashEntry **list; /* gives ordering of options */
int len; /* number of entries in order list */
int max; /* maximum size of order list */
} ItkOptList;
#ifdef USE_ITK_STUBS
EXTERN const char *
Itk_InitStubs(Tcl_Interp *interp,
const char *version, int exact);
#else
#define Itk_InitStubs(interp, version, exact) \
Tcl_PkgRequire(interp, "Itk", version, exact)
#endif
/*
* List of options created in the class definition:
*/
typedef struct ItkClassOptTable {
Tcl_HashTable options; /* option storage with fast lookup */
ItkOptList order; /* gives ordering of options */
} ItkClassOptTable;
/*
* Each option created in the class definition:
*/
typedef struct ItkClassOption {
ItclMember *member; /* info about this option */
char *resName; /* resource name in X11 database */
char *resClass; /* resource class name in X11 database */
char *init; /* initial value for option */
} ItkClassOption;
#include "itkDecls.h"
/*
* Public functions that are not accessible via the stubs table.
*/
# undef TCL_STORAGE_CLASS
# define TCL_STORAGE_CLASS DLLIMPORT
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* RC_INVOKED */
#endif /* RESOURCE INCLUDED */
#endif /* ITK_H */
File diff suppressed because it is too large Load Diff
-149
View File
@@ -1,149 +0,0 @@
/*
* ------------------------------------------------------------------------
* PACKAGE: [incr Tk]
* DESCRIPTION: Building mega-widgets with [incr Tcl]
*
* [incr Tk] provides a framework for building composite "mega-widgets"
* using [incr Tcl] classes. It defines a set of base classes that are
* specialized to create all other widgets.
*
* This file defines the initialization and facilities common to all
* mega-widgets.
*
* ========================================================================
* AUTHOR: Michael J. McLennan
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
* ========================================================================
* 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.
*/
#include "itkInt.h"
/*
* ------------------------------------------------------------------------
* Itk_ConfigBodyCmd()
*
* Replacement for the usual "itcl::configbody" command. Recognizes
* mega-widget options included in a class definition. Options are
* identified by their "switch" name, but without the "-" prefix:
*
* itcl::configbody <class>::<itkOption> <body>
*
* Handles bodies for public variables as well:
*
* itcl::configbody <class>::<publicVar> <body>
*
* If an <itkOption> is found, it has priority over public variables.
* If <body> has the form "@name" then it is treated as a reference
* to a C handling procedure; otherwise, it is taken as a body of
* Tcl statements.
*
* Returns TCL_OK/TCL_ERROR to indicate success/failure.
* ------------------------------------------------------------------------
*/
/* ARGSUSED */
int
Itk_ConfigBodyCmd(
ClientData dummy, /* unused */
Tcl_Interp *interp, /* current interpreter */
int objc, /* number of arguments */
Tcl_Obj *const objv[]) /* argument objects */
{
int result = TCL_OK;
char *token;
const char *head;
const char *tail;
ItclClass *iclsPtr;
ItclMemberCode *mcode;
ItkClassOptTable *optTable;
Tcl_HashEntry *entry;
ItkClassOption *opt;
Tcl_DString buffer;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "class::option body");
return TCL_ERROR;
}
/*
* Parse the member name "namesp::namesp::class::option".
* Make sure that a class name was specified, and that the
* class exists.
*/
token = Tcl_GetString(objv[1]);
Itcl_ParseNamespPath(token, &buffer, &head, &tail);
if (!head || *head == '\0') {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"missing class specifier for body declaration \"", token, "\"",
(char*)NULL);
result = TCL_ERROR;
goto configBodyCmdDone;
}
iclsPtr = Itcl_FindClass(interp, head, /* autoload */ 1);
if (iclsPtr == NULL) {
result = TCL_ERROR;
goto configBodyCmdDone;
}
/*
* Look first for a configuration option with that name.
* If it is not found, assume the reference is for a public
* variable, and use the usual "configbody" implementation
* to handle it.
*/
optTable = Itk_FindClassOptTable(iclsPtr);
opt = NULL;
if (optTable) {
Tcl_DString optName;
Tcl_DStringInit(&optName);
Tcl_DStringAppend(&optName, "-", -1);
Tcl_DStringAppend(&optName, tail, -1);
entry = Tcl_FindHashEntry(&optTable->options,
Tcl_DStringValue(&optName));
if (entry) {
opt = (ItkClassOption*)Tcl_GetHashValue(entry);
}
Tcl_DStringFree(&optName);
}
if (opt == NULL) {
result = Itcl_ConfigBodyCmd(dummy, interp, objc, objv);
goto configBodyCmdDone;
}
/*
* Otherwise, change the implementation for this option.
*/
token = Tcl_GetString(objv[2]);
if (Itcl_CreateMemberCode(interp, iclsPtr, (char*)NULL, token,
&mcode) != TCL_OK) {
result = TCL_ERROR;
goto configBodyCmdDone;
}
Itcl_PreserveData((ClientData)mcode);
#ifdef NOTDEF
Itcl_EventuallyFree((ClientData)mcode, (Tcl_FreeProc *)Itcl_DeleteMemberCode);
#endif
if (opt->codePtr) {
Itcl_ReleaseData((ClientData)opt->codePtr);
}
opt->codePtr = mcode;
configBodyCmdDone:
Tcl_DStringFree(&buffer);
return result;
}
+169 -58
View File
@@ -1,91 +1,202 @@
/*
* itkDecls.h --
*
* Declarations of functions in the platform independent public Tcl 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:
*/
#ifndef _ITKDECLS
#define _ITKDECLS
#ifdef BUILD_itk
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT
#endif
/*
* WARNING: This file is automatically generated by the tools/genStubs.tcl
* script. Any modifications to the function declarations below should be made
* in the generic/tk.decls script.
*/
/* !BEGIN!: Do not edit below this line. */
#define ITK_STUBS_EPOCH 0
#define ITK_STUBS_REVISION 17
#ifdef __cplusplus
extern "C" {
#endif
/*
* Exported function declarations:
*/
/* 0 */
ITKAPI int Itk_Init(Tcl_Interp *interp);
/* 1 */
ITKAPI int Itk_SafeInit(Tcl_Interp *interp);
/* Slot 2 is reserved */
/* Slot 3 is reserved */
/* Slot 4 is reserved */
/* Slot 5 is reserved */
/* Slot 6 is reserved */
/* Slot 7 is reserved */
/* Slot 8 is reserved */
EXTERN int Itk_Init _ANSI_ARGS_((Tcl_Interp * interp));
/* Slot 1 is reserved */
/* 2 */
EXTERN int Itk_ConfigBodyCmd _ANSI_ARGS_((ClientData cdata,
Tcl_Interp * interp, int objc,
Tcl_Obj *CONST objv[]));
/* 3 */
EXTERN int Itk_UsualCmd _ANSI_ARGS_((ClientData cdata,
Tcl_Interp * interp, int objc,
Tcl_Obj *CONST objv[]));
/* 4 */
EXTERN int Itk_ClassOptionDefineCmd _ANSI_ARGS_((
ClientData cdata, Tcl_Interp * interp,
int objc, Tcl_Obj *CONST objv[]));
/* 5 */
EXTERN int Itk_ClassOptionIllegalCmd _ANSI_ARGS_((
ClientData cdata, Tcl_Interp * interp,
int objc, Tcl_Obj *CONST objv[]));
/* 6 */
EXTERN int Itk_ConfigClassOption _ANSI_ARGS_((
Tcl_Interp * interp, ItclObject * contextObj,
ClientData cdata, char* newVal));
/* 7 */
EXTERN ItkClassOptTable* Itk_CreateClassOptTable _ANSI_ARGS_((
Tcl_Interp * interp, ItclClass * cdefn));
/* 8 */
EXTERN ItkClassOptTable* Itk_FindClassOptTable _ANSI_ARGS_((
ItclClass * cdefn));
/* Slot 9 is reserved */
/* Slot 10 is reserved */
/* Slot 11 is reserved */
/* Slot 12 is reserved */
/* 10 */
EXTERN int Itk_CreateClassOption _ANSI_ARGS_((
Tcl_Interp * interp, ItclClass * cdefn,
char * switchName, char * resName,
char * resClass, char * defVal,
char * config, ItkClassOption ** optPtr));
/* 11 */
EXTERN ItkClassOption* Itk_FindClassOption _ANSI_ARGS_((ItclClass * cdefn,
char * switchName));
/* 12 */
EXTERN void Itk_DelClassOption _ANSI_ARGS_((ItkClassOption * opt));
/* 13 */
ITKAPI int Itk_ArchetypeInit(Tcl_Interp*interp);
typedef struct {
const struct ItkIntStubs *itkIntStubs;
} ItkStubHooks;
EXTERN int Itk_ArchetypeInit _ANSI_ARGS_((Tcl_Interp* interp));
/* 14 */
EXTERN void Itk_OptListInit _ANSI_ARGS_((ItkOptList* olist,
Tcl_HashTable * options));
/* 15 */
EXTERN void Itk_OptListFree _ANSI_ARGS_((ItkOptList* olist));
/* 16 */
EXTERN void Itk_OptListAdd _ANSI_ARGS_((ItkOptList* olist,
Tcl_HashEntry * entry));
/* 17 */
EXTERN void Itk_OptListRemove _ANSI_ARGS_((ItkOptList* olist,
Tcl_HashEntry * entry));
typedef struct ItkStubs {
int magic;
int epoch;
int revision;
const ItkStubHooks *hooks;
struct ItkStubHooks *hooks;
int (*itk_Init) (Tcl_Interp *interp); /* 0 */
int (*itk_SafeInit) (Tcl_Interp *interp); /* 1 */
void (*reserved2)(void);
void (*reserved3)(void);
void (*reserved4)(void);
void (*reserved5)(void);
void (*reserved6)(void);
void (*reserved7)(void);
void (*reserved8)(void);
void (*reserved9)(void);
void (*reserved10)(void);
void (*reserved11)(void);
void (*reserved12)(void);
int (*itk_ArchetypeInit) (Tcl_Interp*interp); /* 13 */
int (*itk_Init) _ANSI_ARGS_((Tcl_Interp * interp)); /* 0 */
void *reserved1;
int (*itk_ConfigBodyCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 2 */
int (*itk_UsualCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 3 */
int (*itk_ClassOptionDefineCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 4 */
int (*itk_ClassOptionIllegalCmd) _ANSI_ARGS_((ClientData cdata, Tcl_Interp * interp, int objc, Tcl_Obj *CONST objv[])); /* 5 */
int (*itk_ConfigClassOption) _ANSI_ARGS_((Tcl_Interp * interp, ItclObject * contextObj, ClientData cdata, char* newVal)); /* 6 */
ItkClassOptTable* (*itk_CreateClassOptTable) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn)); /* 7 */
ItkClassOptTable* (*itk_FindClassOptTable) _ANSI_ARGS_((ItclClass * cdefn)); /* 8 */
void *reserved9;
int (*itk_CreateClassOption) _ANSI_ARGS_((Tcl_Interp * interp, ItclClass * cdefn, char * switchName, char * resName, char * resClass, char * defVal, char * config, ItkClassOption ** optPtr)); /* 10 */
ItkClassOption* (*itk_FindClassOption) _ANSI_ARGS_((ItclClass * cdefn, char * switchName)); /* 11 */
void (*itk_DelClassOption) _ANSI_ARGS_((ItkClassOption * opt)); /* 12 */
int (*itk_ArchetypeInit) _ANSI_ARGS_((Tcl_Interp* interp)); /* 13 */
void (*itk_OptListInit) _ANSI_ARGS_((ItkOptList* olist, Tcl_HashTable * options)); /* 14 */
void (*itk_OptListFree) _ANSI_ARGS_((ItkOptList* olist)); /* 15 */
void (*itk_OptListAdd) _ANSI_ARGS_((ItkOptList* olist, Tcl_HashEntry * entry)); /* 16 */
void (*itk_OptListRemove) _ANSI_ARGS_((ItkOptList* olist, Tcl_HashEntry * entry)); /* 17 */
} ItkStubs;
extern const ItkStubs *itkStubsPtr;
#ifdef __cplusplus
extern "C" {
#endif
extern ItkStubs *itkStubsPtr;
#ifdef __cplusplus
}
#endif
#if defined(USE_ITK_STUBS)
#if defined(USE_ITK_STUBS) && !defined(USE_ITK_STUB_PROCS)
/*
* Inline function declarations:
*/
#ifndef Itk_Init
#define Itk_Init \
(itkStubsPtr->itk_Init) /* 0 */
#define Itk_SafeInit \
(itkStubsPtr->itk_SafeInit) /* 1 */
/* Slot 2 is reserved */
/* Slot 3 is reserved */
/* Slot 4 is reserved */
/* Slot 5 is reserved */
/* Slot 6 is reserved */
/* Slot 7 is reserved */
/* Slot 8 is reserved */
#endif
/* Slot 1 is reserved */
#ifndef Itk_ConfigBodyCmd
#define Itk_ConfigBodyCmd \
(itkStubsPtr->itk_ConfigBodyCmd) /* 2 */
#endif
#ifndef Itk_UsualCmd
#define Itk_UsualCmd \
(itkStubsPtr->itk_UsualCmd) /* 3 */
#endif
#ifndef Itk_ClassOptionDefineCmd
#define Itk_ClassOptionDefineCmd \
(itkStubsPtr->itk_ClassOptionDefineCmd) /* 4 */
#endif
#ifndef Itk_ClassOptionIllegalCmd
#define Itk_ClassOptionIllegalCmd \
(itkStubsPtr->itk_ClassOptionIllegalCmd) /* 5 */
#endif
#ifndef Itk_ConfigClassOption
#define Itk_ConfigClassOption \
(itkStubsPtr->itk_ConfigClassOption) /* 6 */
#endif
#ifndef Itk_CreateClassOptTable
#define Itk_CreateClassOptTable \
(itkStubsPtr->itk_CreateClassOptTable) /* 7 */
#endif
#ifndef Itk_FindClassOptTable
#define Itk_FindClassOptTable \
(itkStubsPtr->itk_FindClassOptTable) /* 8 */
#endif
/* Slot 9 is reserved */
/* Slot 10 is reserved */
/* Slot 11 is reserved */
/* Slot 12 is reserved */
#ifndef Itk_CreateClassOption
#define Itk_CreateClassOption \
(itkStubsPtr->itk_CreateClassOption) /* 10 */
#endif
#ifndef Itk_FindClassOption
#define Itk_FindClassOption \
(itkStubsPtr->itk_FindClassOption) /* 11 */
#endif
#ifndef Itk_DelClassOption
#define Itk_DelClassOption \
(itkStubsPtr->itk_DelClassOption) /* 12 */
#endif
#ifndef Itk_ArchetypeInit
#define Itk_ArchetypeInit \
(itkStubsPtr->itk_ArchetypeInit) /* 13 */
#endif
#ifndef Itk_OptListInit
#define Itk_OptListInit \
(itkStubsPtr->itk_OptListInit) /* 14 */
#endif
#ifndef Itk_OptListFree
#define Itk_OptListFree \
(itkStubsPtr->itk_OptListFree) /* 15 */
#endif
#ifndef Itk_OptListAdd
#define Itk_OptListAdd \
(itkStubsPtr->itk_OptListAdd) /* 16 */
#endif
#ifndef Itk_OptListRemove
#define Itk_OptListRemove \
(itkStubsPtr->itk_OptListRemove) /* 17 */
#endif
#endif /* defined(USE_ITK_STUBS) */
#endif /* defined(USE_ITK_STUBS) && !defined(USE_ITK_STUB_PROCS) */
/* !END!: Do not edit above this line. */
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT
#endif /* _ITKDECLS */
-195
View File
@@ -1,195 +0,0 @@
/*
* ------------------------------------------------------------------------
* PACKAGE: [incr Tk]
* DESCRIPTION: Building mega-widgets with [incr Tcl]
*
* [incr Tk] provides a framework for building composite "mega-widgets"
* using [incr Tcl] classes. It defines a set of base classes that are
* specialized to create all other widgets.
*
* This part adds C implementations for some helxeper methods in the
* base class itk::Archetype.
*
* ========================================================================
* AUTHOR: Michael J. McLennan
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
* ========================================================================
* 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.
*/
#include <assert.h>
#include "itkInt.h"
/*
* ------------------------------------------------------------------------
* Itk_ArchOptConfigError()
*
* Simply utility which adds error information after a option
* configuration fails. Adds traceback information to the given
* interpreter.
* ------------------------------------------------------------------------
*/
void
Itk_ArchOptConfigError(
Tcl_Interp *interp, /* interpreter handling this object */
ArchInfo *info, /* info associated with mega-widget */
ArchOption *archOpt) /* configuration option that failed */
{
Tcl_Obj *objPtr;
objPtr = Tcl_NewStringObj((char*)NULL, 0);
Tcl_IncrRefCount(objPtr);
Tcl_AppendToObj(objPtr, "\n (while configuring option \"", -1);
Tcl_AppendToObj(objPtr, archOpt->switchName, -1);
Tcl_AppendToObj(objPtr, "\"", -1);
if (info->itclObj && info->itclObj->accessCmd) {
Tcl_AppendToObj(objPtr, " for widget \"", -1);
Tcl_GetCommandFullName(interp, info->itclObj->accessCmd, objPtr);
Tcl_AppendToObj(objPtr, "\")", -1);
}
Tcl_AddErrorInfo(interp, Tcl_GetStringFromObj(objPtr, (int*)NULL));
Tcl_DecrRefCount(objPtr);
}
/*
* ------------------------------------------------------------------------
* Itk_ArchOptAccessError()
*
* Simply utility which adds error information after an option
* value access fails. Adds traceback information to the given
* interpreter.
* ------------------------------------------------------------------------
*/
void
Itk_ArchOptAccessError(
Tcl_Interp *interp, /* interpreter handling this object */
ArchInfo *info, /* info associated with mega-widget */
ArchOption *archOpt) /* option that couldn't be accessed */
{
Tcl_ResetResult(interp);
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"internal error: cannot access itk_option(", archOpt->switchName, ")",
(char*)NULL);
if (info->itclObj->accessCmd) {
Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
Tcl_AppendToObj(resultPtr, " in widget \"", -1);
Tcl_GetCommandFullName(interp, info->itclObj->accessCmd, resultPtr);
Tcl_AppendToObj(resultPtr, "\"", -1);
}
}
/*
* ------------------------------------------------------------------------
* Itk_GetArchInfo()
*
* Finds the extra Archetype info associated with the given object.
* Returns TCL_OK and a pointer to the info if found. Returns
* TCL_ERROR along with an error message in interp->result if not.
* ------------------------------------------------------------------------
*/
int
Itk_GetArchInfo(
Tcl_Interp *interp, /* interpreter handling this object */
ItclObject *contextObj, /* object with desired data */
ArchInfo **infoPtr) /* returns: pointer to extra info */
{
Tcl_HashTable *objsWithArchInfo;
Tcl_HashEntry *entry;
/*
* If there is any problem finding the info, return an error.
*/
objsWithArchInfo = ItkGetObjsWithArchInfo(interp);
entry = Tcl_FindHashEntry(objsWithArchInfo, (char*)contextObj);
if (!entry) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"internal error: no Archetype information for widget",
(char*)NULL);
if (contextObj->accessCmd) {
Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
Tcl_AppendToObj(resultPtr, " \"", -1);
Tcl_GetCommandFullName(interp, contextObj->accessCmd, resultPtr);
Tcl_AppendToObj(resultPtr, "\"", -1);
}
return TCL_ERROR;
}
/*
* Otherwise, return the requested info.
*/
*infoPtr = (ArchInfo*)Tcl_GetHashValue(entry);
return TCL_OK;
}
/*
* ------------------------------------------------------------------------
* ItkGetObjsWithArchInfo()
*
* Returns a pointer to a hash table containing the list of registered
* objects in the specified interpreter. If the hash table does not
* already exist, it is created.
* ------------------------------------------------------------------------
*/
Tcl_HashTable*
ItkGetObjsWithArchInfo(
Tcl_Interp *interp) /* interpreter handling this registration */
{
Tcl_HashTable* objTable;
/*
* If the registration table does not yet exist, then create it.
*/
objTable = (Tcl_HashTable*)Tcl_GetAssocData(interp,
"itk_objsWithArchInfo", (Tcl_InterpDeleteProc**)NULL);
if (!objTable) {
objTable = (Tcl_HashTable*)ckalloc(sizeof(Tcl_HashTable));
Tcl_InitHashTable(objTable, TCL_ONE_WORD_KEYS);
Tcl_SetAssocData(interp, "itk_objsWithArchInfo",
ItkFreeObjsWithArchInfo, (ClientData)objTable);
}
return objTable;
}
/*
* ------------------------------------------------------------------------
* ItkFreeObjsWithArchInfo()
*
* When an interpreter is deleted, this procedure is called to
* free up the associated data created by ItkGetObjsWithArchInfo.
* ------------------------------------------------------------------------
*/
void
ItkFreeObjsWithArchInfo(
ClientData clientData, /* associated data */
Tcl_Interp *interp) /* interpreter being freed */
{
Tcl_HashTable *tablePtr = (Tcl_HashTable*)clientData;
Tcl_HashSearch place;
Tcl_HashEntry *entry;
entry = Tcl_FirstHashEntry(tablePtr, &place);
while (entry) {
Itk_DelArchInfo( Tcl_GetHashValue(entry) );
entry = Tcl_NextHashEntry(&place);
}
Tcl_DeleteHashTable(tablePtr);
ckfree((char*)tablePtr);
}
-221
View File
@@ -1,221 +0,0 @@
/*
* ------------------------------------------------------------------------
* PACKAGE: [incr Tk]
* DESCRIPTION: Building mega-widgets with [incr Tcl]
*
* [incr Tk] provides a framework for building composite "mega-widgets"
* using [incr Tcl] classes. It defines a set of base classes that are
* specialized to create all other widgets.
*
*
* ========================================================================
* AUTHOR: Michael J. McLennan
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
* ========================================================================
* 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.
*/
#include <itclInt.h>
#include "itk.h"
/*
* List of options in alphabetical order:
*/
typedef struct ItkOptList {
Tcl_HashTable *options; /* list containing the real options */
Tcl_HashEntry **list; /* gives ordering of options */
int len; /* number of entries in order list */
int max; /* maximum size of order list */
} ItkOptList;
/*
* List of options created in the class definition:
*/
typedef struct ItkClassOptTable {
Tcl_HashTable options; /* option storage with fast lookup */
ItkOptList order; /* gives ordering of options */
} ItkClassOptTable;
/*
* Each option created in the class definition:
*/
typedef struct ItkClassOption {
Tcl_Obj* namePtr; /* member name */
Tcl_Obj* fullNamePtr; /* member name with "class::" qualifier */
ItclClass* iclsPtr; /* class containing this member */
int protection; /* protection level */
int flags; /* flags describing member (see above) */
ItclMemberCode *codePtr; /* code associated with member */
char *resName; /* resource name in X11 database */
char *resClass; /* resource class name in X11 database */
char *init; /* initial value for option */
} ItkClassOption;
/*
* Info associated with each Archetype mega-widget:
*/
typedef struct ArchInfo {
ItclObject *itclObj; /* object containing this info */
Tk_Window tkwin; /* window representing this mega-widget */
Tcl_HashTable components; /* list of all mega-widget components */
Tcl_HashTable options; /* list of all mega-widget options */
ItkOptList order; /* gives ordering of options */
} ArchInfo;
/*
* Each component widget in an Archetype mega-widget:
*/
typedef struct ArchComponent {
Tcl_Obj* namePtr; /* member name */
Tcl_Obj* fullNamePtr; /* member name with "class::" qualifier */
ItclClass* iclsPtr; /* class containing this member */
int protection; /* protection level */
int flags; /* flags describing member (see above) */
ItclMemberCode *codePtr; /* code associated with member */
Tcl_Command accessCmd; /* access command for component widget */
Tk_Window tkwin; /* Tk window for this component widget */
char *pathName; /* Tk path name for this component widget.
We can't use the tkwin pointer after
the window has been destroyed so we
need to save a copy for use in
Itk_ArchCompDeleteCmd() */
} ArchComponent;
/*
* Each option in an Archetype mega-widget:
*/
typedef struct ArchOption {
char *switchName; /* command-line switch for this option */
char *resName; /* resource name in X11 database */
char *resClass; /* resource class name in X11 database */
char *init; /* initial value for option */
int flags; /* flags representing option state */
Itcl_List parts; /* parts relating to this option */
} ArchOption;
/*
* Flag bits for ArchOption state:
*/
#define ITK_ARCHOPT_INIT 0x01 /* option has been initialized */
/*
* Various parts of a composite option in an Archetype mega-widget:
*/
typedef int (Itk_ConfigOptionPartProc) (Tcl_Interp *interp,
ItclObject *contextObj, ClientData cdata, const char* newVal);
typedef struct ArchOptionPart {
ClientData clientData; /* data associated with this part */
Itk_ConfigOptionPartProc *configProc; /* update when new vals arrive */
Tcl_CmdDeleteProc *deleteProc; /* clean up after clientData */
ClientData from; /* token that indicates who
* contributed this option part */
} ArchOptionPart;
/*
* Info kept by the itk::option-parser namespace and shared by
* all option processing commands:
*/
typedef struct ArchMergeInfo {
Tcl_HashTable usualCode; /* usual option handling code for the
* various widget classes */
ArchInfo *archInfo; /* internal option info for mega-widget */
ArchComponent *archComp; /* component being merged into mega-widget */
Tcl_HashTable *optionTable; /* table of valid configuration options
* for component being merged */
} ArchMergeInfo;
/*
* Used to capture component widget configuration options when a
* new component is being merged into a mega-widget:
*/
typedef struct GenericConfigOpt {
char *switchName; /* command-line switch for this option */
char *resName; /* resource name in X11 database */
char *resClass; /* resource class name in X11 database */
char *init; /* initial value for this option */
char *value; /* current value for this option */
char **storage; /* storage for above strings */
ArchOption *integrated; /* integrated into this mega-widget option */
ArchOptionPart *optPart; /* integrated as this option part */
} GenericConfigOpt;
/*
* Options that are propagated by a "configure" method:
*/
typedef struct ConfigCmdline {
Tcl_Obj *objv[4]; /* objects representing "configure" command */
} ConfigCmdline;
MODULE_SCOPE int Itk_ArchInitOptsCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchDeleteOptsCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchComponentCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchInitCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchOptionCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchCompAccessCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchConfigureCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchCgetCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchCompAddCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchCompDeleteCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchConfigOption (Tcl_Interp *interp,
ArchInfo *info, char *name, char *value);
MODULE_SCOPE int Itk_ArchOptionAddCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchOptionRemoveCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_PropagatePublicVar (Tcl_Interp *interp,
ItclObject *contextObj, ClientData cdata, const char *newval);
MODULE_SCOPE int Itk_GetArchInfo (Tcl_Interp *interp,
ItclObject* contextObj, ArchInfo **infoPtr);
MODULE_SCOPE void Itk_ArchOptConfigError (Tcl_Interp *interp,
ArchInfo *info, ArchOption *archOpt);
MODULE_SCOPE void Itk_ArchOptAccessError (Tcl_Interp *interp,
ArchInfo *info, ArchOption *archOpt);
MODULE_SCOPE ArchOptionPart* Itk_CreateOptionPart (
Tcl_Interp *interp, ClientData cdata, Itk_ConfigOptionPartProc* cproc,
Tcl_CmdDeleteProc *dproc, ClientData from);
MODULE_SCOPE int Itk_AddOptionPart (Tcl_Interp *interp,
ArchInfo *info, char *switchName, char *resName, char *resClass,
const char *defVal, char *currVal, ArchOptionPart *optPart,
ArchOption **raOpt);
MODULE_SCOPE ArchOptionPart* Itk_FindArchOptionPart (
ArchInfo *info, char *switchName, ClientData from);
MODULE_SCOPE void Itk_DelOptionPart (ArchOptionPart *optPart);
MODULE_SCOPE void Itk_DelArchInfo (ClientData cdata);
MODULE_SCOPE Tcl_HashTable* ItkGetObjsWithArchInfo
(Tcl_Interp *interp);
MODULE_SCOPE void ItkFreeObjsWithArchInfo (ClientData cdata,
Tcl_Interp *interp);
MODULE_SCOPE void Itk_DelMergeInfo (void* cdata);
MODULE_SCOPE int Itk_ArchOptKeepCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchOptIgnoreCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchOptRenameCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
MODULE_SCOPE int Itk_ArchOptUsualCmd (ClientData cdata,
Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
#include "itkIntDecls.h"
-144
View File
@@ -1,144 +0,0 @@
/* !BEGIN!: Do not edit below this line. */
#define ITKINT_STUBS_EPOCH 0
#define ITKINT_STUBS_REVISION 17
#ifdef __cplusplus
extern "C" {
#endif
/*
* Exported function declarations:
*/
/* Slot 0 is reserved */
/* Slot 1 is reserved */
/* 2 */
ITKAPI int Itk_ConfigBodyCmd(ClientData cdata,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
/* 3 */
ITKAPI int Itk_UsualCmd(ClientData cdata, Tcl_Interp *interp,
int objc, Tcl_Obj *const objv[]);
/* 4 */
ITKAPI int Itk_ClassOptionDefineCmd(ClientData cdata,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
/* 5 */
ITKAPI int Itk_ClassOptionIllegalCmd(ClientData cdata,
Tcl_Interp *interp, int objc,
Tcl_Obj *const objv[]);
/* 6 */
ITKAPI int Itk_ConfigClassOption(Tcl_Interp *interp,
ItclObject *contextObj, ClientData cdata,
const char*newVal);
/* 7 */
ITKAPI ItkClassOptTable* Itk_CreateClassOptTable(Tcl_Interp *interp,
ItclClass *cdefn);
/* 8 */
ITKAPI ItkClassOptTable* Itk_FindClassOptTable(ItclClass *cdefn);
/* Slot 9 is reserved */
/* 10 */
ITKAPI int Itk_CreateClassOption(Tcl_Interp *interp,
ItclClass *cdefn, char *switchName,
char *resName, char *resClass, char *defVal,
char *config, ItkClassOption **optPtr);
/* 11 */
ITKAPI ItkClassOption* Itk_FindClassOption(ItclClass *cdefn,
const char *switchName);
/* 12 */
ITKAPI void Itk_DelClassOption(ItkClassOption *opt);
/* Slot 13 is reserved */
/* 14 */
ITKAPI void Itk_OptListInit(ItkOptList*olist,
Tcl_HashTable *options);
/* 15 */
ITKAPI void Itk_OptListFree(ItkOptList*olist);
/* 16 */
ITKAPI void Itk_OptListAdd(ItkOptList*olist,
Tcl_HashEntry *entry);
/* 17 */
ITKAPI void Itk_OptListRemove(ItkOptList*olist,
Tcl_HashEntry *entry);
typedef struct ItkIntStubs {
int magic;
int epoch;
int revision;
void *hooks;
void (*reserved0)(void);
void (*reserved1)(void);
int (*itk_ConfigBodyCmd) (ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 2 */
int (*itk_UsualCmd) (ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 3 */
int (*itk_ClassOptionDefineCmd) (ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 4 */
int (*itk_ClassOptionIllegalCmd) (ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 5 */
int (*itk_ConfigClassOption) (Tcl_Interp *interp, ItclObject *contextObj, ClientData cdata, const char*newVal); /* 6 */
ItkClassOptTable* (*itk_CreateClassOptTable) (Tcl_Interp *interp, ItclClass *cdefn); /* 7 */
ItkClassOptTable* (*itk_FindClassOptTable) (ItclClass *cdefn); /* 8 */
void (*reserved9)(void);
int (*itk_CreateClassOption) (Tcl_Interp *interp, ItclClass *cdefn, char *switchName, char *resName, char *resClass, char *defVal, char *config, ItkClassOption **optPtr); /* 10 */
ItkClassOption* (*itk_FindClassOption) (ItclClass *cdefn, const char *switchName); /* 11 */
void (*itk_DelClassOption) (ItkClassOption *opt); /* 12 */
void (*reserved13)(void);
void (*itk_OptListInit) (ItkOptList*olist, Tcl_HashTable *options); /* 14 */
void (*itk_OptListFree) (ItkOptList*olist); /* 15 */
void (*itk_OptListAdd) (ItkOptList*olist, Tcl_HashEntry *entry); /* 16 */
void (*itk_OptListRemove) (ItkOptList*olist, Tcl_HashEntry *entry); /* 17 */
} ItkIntStubs;
extern const ItkIntStubs *itkIntStubsPtr;
#ifdef __cplusplus
}
#endif
#if defined(USE_ITK_STUBS)
/*
* Inline function declarations:
*/
/* Slot 0 is reserved */
/* Slot 1 is reserved */
#define Itk_ConfigBodyCmd \
(itkIntStubsPtr->itk_ConfigBodyCmd) /* 2 */
#define Itk_UsualCmd \
(itkIntStubsPtr->itk_UsualCmd) /* 3 */
#define Itk_ClassOptionDefineCmd \
(itkIntStubsPtr->itk_ClassOptionDefineCmd) /* 4 */
#define Itk_ClassOptionIllegalCmd \
(itkIntStubsPtr->itk_ClassOptionIllegalCmd) /* 5 */
#define Itk_ConfigClassOption \
(itkIntStubsPtr->itk_ConfigClassOption) /* 6 */
#define Itk_CreateClassOptTable \
(itkIntStubsPtr->itk_CreateClassOptTable) /* 7 */
#define Itk_FindClassOptTable \
(itkIntStubsPtr->itk_FindClassOptTable) /* 8 */
/* Slot 9 is reserved */
#define Itk_CreateClassOption \
(itkIntStubsPtr->itk_CreateClassOption) /* 10 */
#define Itk_FindClassOption \
(itkIntStubsPtr->itk_FindClassOption) /* 11 */
#define Itk_DelClassOption \
(itkIntStubsPtr->itk_DelClassOption) /* 12 */
/* Slot 13 is reserved */
#define Itk_OptListInit \
(itkIntStubsPtr->itk_OptListInit) /* 14 */
#define Itk_OptListFree \
(itkIntStubsPtr->itk_OptListFree) /* 15 */
#define Itk_OptListAdd \
(itkIntStubsPtr->itk_OptListAdd) /* 16 */
#define Itk_OptListRemove \
(itkIntStubsPtr->itk_OptListRemove) /* 17 */
#endif /* defined(USE_ITK_STUBS) */
/* !END!: Do not edit above this line. */
struct ItkStubAPI {
ItkStubs *stubsPtr;
ItkIntStubs *intStubsPtr;
};
+10 -37
View File
@@ -1,4 +1,4 @@
/*
/*
* tkStubInit.c --
*
* This file contains the initializers for the Itk stub vectors.
@@ -7,9 +7,11 @@
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS:
*/
#include "itkInt.h"
#include "itk.h"
/*
* Remove macros that will interfere with the definitions below.
@@ -21,17 +23,13 @@
* below should be made in the generic/itk.decls script.
*/
MODULE_SCOPE const ItkStubs itkStubs;
/* !BEGIN!: Do not edit below this line. */
static const ItkIntStubs itkIntStubs = {
ItkStubs itkStubs = {
TCL_STUB_MAGIC,
ITKINT_STUBS_EPOCH,
ITKINT_STUBS_REVISION,
0,
0, /* 0 */
0, /* 1 */
NULL,
Itk_Init, /* 0 */
NULL, /* 1 */
Itk_ConfigBodyCmd, /* 2 */
Itk_UsualCmd, /* 3 */
Itk_ClassOptionDefineCmd, /* 4 */
@@ -39,40 +37,15 @@ static const ItkIntStubs itkIntStubs = {
Itk_ConfigClassOption, /* 6 */
Itk_CreateClassOptTable, /* 7 */
Itk_FindClassOptTable, /* 8 */
0, /* 9 */
NULL, /* 9 */
Itk_CreateClassOption, /* 10 */
Itk_FindClassOption, /* 11 */
Itk_DelClassOption, /* 12 */
0, /* 13 */
Itk_ArchetypeInit, /* 13 */
Itk_OptListInit, /* 14 */
Itk_OptListFree, /* 15 */
Itk_OptListAdd, /* 16 */
Itk_OptListRemove, /* 17 */
};
static const ItkStubHooks itkStubHooks = {
&itkIntStubs
};
const ItkStubs itkStubs = {
TCL_STUB_MAGIC,
ITK_STUBS_EPOCH,
ITK_STUBS_REVISION,
&itkStubHooks,
Itk_Init, /* 0 */
Itk_SafeInit, /* 1 */
0, /* 2 */
0, /* 3 */
0, /* 4 */
0, /* 5 */
0, /* 6 */
0, /* 7 */
0, /* 8 */
0, /* 9 */
0, /* 10 */
0, /* 11 */
0, /* 12 */
Itk_ArchetypeInit, /* 13 */
};
/* !END!: Do not edit above this line. */
+26 -14
View File
@@ -1,4 +1,4 @@
/*
/*
* itkStubLib.c --
*
* Stub object that will be statically linked into extensions that wish
@@ -9,6 +9,8 @@
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS:
*/
/*
@@ -23,14 +25,23 @@
#endif
#undef USE_TCL_STUB_PROCS
#ifndef USE_ITK_STUBS
#define USE_ITK_STUBS 1
#ifndef USE_ITCL_STUBS
#define USE_ITCL_STUBS
#endif
#undef USE_ITK_STUB_PROCS
#undef BUILD_itk
#undef USE_ITCL_STUB_PROCS
#include "itk.h"
/*
* Ensure that Itcl_InitStubs is built as an exported symbol. The other stub
* functions should be built as non-exported symbols.
*/
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLEXPORT
ItkStubs *itkStubsPtr;
/*
*----------------------------------------------------------------------
@@ -50,20 +61,21 @@
*----------------------------------------------------------------------
*/
const char *
Itk_InitStubs (
Tcl_Interp *interp,
const char *version,
int exact)
char *
Itk_InitStubs (interp, version, exact)
Tcl_Interp *interp;
char *version;
int exact;
{
const char *actualVersion;
char *actualVersion;
actualVersion = Tcl_PkgRequireEx(interp, "Itk", version, exact,
(ClientData *) &itkStubsPtr);
actualVersion = Tcl_PkgRequireEx(interp, "itk", (const char *)version,
exact, (ClientData *) &itkStubsPtr);
if (actualVersion == NULL) {
itkStubsPtr = NULL;
return NULL;
}
return actualVersion;
}
File diff suppressed because it is too large Load Diff
+147 -121
View File
@@ -15,33 +15,21 @@
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
*
* RCS: $Id: itk_cmds.c,v 1.6 1999/05/25 01:35:20 redman Exp $
* ========================================================================
* 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.
*/
#include "itkInt.h"
#include "itkUuid.h"
MODULE_SCOPE const ItkStubs itkStubs;
/*
* The following script is used to initialize Itcl in a safe interpreter.
*/
static char safeInitScript[] =
"proc ::itcl::local {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\
}";
#include "itk.h"
/*
* FORWARD DECLARATIONS
*/
static int Initialize (Tcl_Interp *interp);
static int Initialize _ANSI_ARGS_((Tcl_Interp *interp));
/*
* The following string is the startup script executed in new
* interpreters. It looks on disk in several different directories
@@ -55,28 +43,24 @@ namespace eval ::itk {\n\
proc _find_init {} {\n\
global env tcl_library\n\
variable library\n\
variable patchLevel\n\
variable version\n\
rename _find_init {}\n\
if {[info exists library]} {\n\
lappend dirs $library\n\
} else {\n\
if {[catch {uplevel #0 source -rsrc itk}] == 0} {\n\
return\n\
}\n\
set dirs {}\n\
if {[info exists env(ITK_LIBRARY)]} {\n\
lappend dirs $env(ITK_LIBRARY)\n\
}\n\
lappend dirs [file join [file dirname $tcl_library] itk$patchLevel]\n\
lappend dirs [file join [file dirname $tcl_library] itk$version]\n\
set bindir [file dirname [info nameofexecutable]]\n\
lappend dirs [file join $bindir .. lib itk$patchLevel]\n\
lappend dirs [file join $bindir .. lib itk$version]\n\
lappend dirs [file join $bindir .. library]\n\
lappend dirs [file join $bindir .. .. library]\n\
lappend dirs [file join $bindir .. .. itk library]\n\
# On MacOSX, check the directories in the tcl_pkgPath\n\
if {[string equal $::tcl_platform(platform) \"unix\"] && \
[string equal $::tcl_platform(os) \"Darwin\"]} {\n\
foreach d $::tcl_pkgPath {\n\
lappend dirs [file join $d itk$patchLevel]\n\
}\n\
}\n\
}\n\
foreach i $dirs {\n\
set library $i\n\
@@ -95,6 +79,11 @@ namespace eval ::itk {\n\
}\n\
_find_init\n\
}";
extern ItkStubs itkStubs;
ItclStubs *itclStubsPtr;
ItclIntStubs *itclIntStubsPtr;
/*
* ------------------------------------------------------------------------
@@ -109,30 +98,27 @@ namespace eval ::itk {\n\
* message in the interpreter) if anything goes wrong.
* ------------------------------------------------------------------------
*/
#ifndef STRINGIFY
# define STRINGIFY(x) STRINGIFY1(x)
# define STRINGIFY1(x) #x
#endif
static int
Initialize(
Tcl_Interp *interp) /* interpreter to be updated */
Initialize(interp)
Tcl_Interp *interp; /* interpreter to be updated */
{
Tcl_Namespace *itkNs, *parserNs;
ClientData parserInfo;
Tcl_CmdInfo info;
if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
return TCL_ERROR;
}
if (Tk_InitStubs(interp, TK_VERSION, 0) == NULL) {
if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
return TCL_ERROR;
};
if (Itcl_InitStubs(interp, "4.1", 0) == NULL) {
if (Tk_InitStubs(interp, "8.1", 0) == NULL) {
return TCL_ERROR;
};
if (Tcl_PkgRequireEx(interp, "Itcl", ITCL_VERSION, 0,
(ClientData *) &itclStubsPtr) == NULL) {
return TCL_ERROR;
}
itclIntStubsPtr = itclStubsPtr->hooks->itclIntStubs;
/*
* Add the "itk_option" ensemble to the itcl class definition parser.
*/
@@ -208,82 +194,24 @@ Initialize(
Tcl_CreateObjCommand(interp, "::itcl::configbody", Itk_ConfigBodyCmd,
(ClientData)NULL, (Tcl_CmdDeleteProc*)NULL);
Tcl_SetVar(interp, "::itk::version", ITK_VERSION, TCL_NAMESPACE_ONLY);
Tcl_SetVar(interp, "::itk::patchLevel", ITK_PATCH_LEVEL,
TCL_NAMESPACE_ONLY);
Tcl_SetVar(interp, "::itk::version", ITCL_VERSION, 0);
Tcl_SetVar(interp, "::itk::patchLevel", ITCL_PATCH_LEVEL, 0);
/*
* Signal that the package has been loaded and provide the Itk Stubs table
* for dependent modules. I know this is unlikely, but possible that
* someone could be extending Itk. Who is to say that Itk is the
* end-of-the-line?
* Signal that the package has been loaded.
*/
if (Tcl_GetCommandInfo(interp, "::tcl::build-info", &info)) {
Tcl_CreateObjCommand(interp, "::itk::build-info",
info.objProc, (void *)(PACKAGE_VERSION "+" STRINGIFY(ITK_VERSION_UUID)
#if defined(__clang__) && defined(__clang_major__)
".clang-" STRINGIFY(__clang_major__)
#if __clang_minor__ < 10
"0"
#endif
STRINGIFY(__clang_minor__)
#endif
#if defined(__cplusplus) && !defined(__OBJC__)
".cplusplus"
#endif
#ifndef NDEBUG
".debug"
#endif
#if !defined(__clang__) && !defined(__INTEL_COMPILER) && defined(__GNUC__)
".gcc-" STRINGIFY(__GNUC__)
#if __GNUC_MINOR__ < 10
"0"
#endif
STRINGIFY(__GNUC_MINOR__)
#endif
#ifdef __INTEL_COMPILER
".icc-" STRINGIFY(__INTEL_COMPILER)
#endif
#ifdef TCL_MEM_DEBUG
".memdebug"
#endif
#if defined(_MSC_VER)
".msvc-" STRINGIFY(_MSC_VER)
#endif
#ifdef USE_NMAKE
".nmake"
#endif
#ifndef TCL_CFG_OPTIMIZED
".no-optimize"
#endif
#ifdef __OBJC__
".objective-c"
#if defined(__cplusplus)
"plusplus"
#endif
#endif
#ifdef TCL_CFG_PROFILED
".profile"
#endif
#ifdef PURIFY
".purify"
#endif
#ifdef STATIC_BUILD
".static"
#endif
), NULL);
if (Tcl_PkgProvideEx(interp, "Itk", ITCL_VERSION,
(ClientData) &itkStubs) != TCL_OK) {
return TCL_ERROR;
}
Tcl_PkgProvideEx(interp, "Itk", ITK_PATCH_LEVEL, (ClientData) &itkStubs);
return Tcl_PkgProvideEx(interp, "itk", ITK_PATCH_LEVEL,
(ClientData) &itkStubs);
return TCL_OK;
}
/*
* ------------------------------------------------------------------------
* Itk_Init()
*
* Invoked whenever a new interpreter is created to install the
* Invoked whenever a new interpeter is created to install the
* [incr Tcl] package. Usually invoked within Tcl_AppInit() at
* the start of execution.
*
@@ -294,36 +222,134 @@ Initialize(
* ------------------------------------------------------------------------
*/
int
Itk_Init(
Tcl_Interp *interp) /* interpreter to be updated */
Itk_Init(interp)
Tcl_Interp *interp; /* interpreter to be updated */
{
if (Initialize(interp) != TCL_OK) {
return TCL_ERROR;
}
return Tcl_EvalEx(interp, initScript, -1, 0);
return Tcl_Eval(interp, initScript);
return TCL_OK;
}
/*
* ------------------------------------------------------------------------
* Itk_SafeInit()
* Itk_ConfigBodyCmd()
*
* Invoked whenever a new SAFE INTERPRETER is created to install
* the [incr Tcl] package.
* Replacement for the usual "itcl::configbody" command. Recognizes
* mega-widget options included in a class definition. Options are
* identified by their "switch" name, but without the "-" prefix:
*
* Creates the "::itk" namespace and installs access commands for
* creating classes and querying info.
* itcl::configbody <class>::<itkOption> <body>
*
* Returns TCL_OK on success, or TCL_ERROR (along with an error
* message in the interpreter) if anything goes wrong.
* Handles bodies for public variables as well:
*
* itcl::configbody <class>::<publicVar> <body>
*
* If an <itkOption> is found, it has priority over public variables.
* If <body> has the form "@name" then it is treated as a reference
* to a C handling procedure; otherwise, it is taken as a body of
* Tcl statements.
*
* Returns TCL_OK/TCL_ERROR to indicate success/failure.
* ------------------------------------------------------------------------
*/
/* ARGSUSED */
int
Itk_SafeInit(
Tcl_Interp *interp) /* interpreter to be updated */
Itk_ConfigBodyCmd(dummy, interp, objc, objv)
ClientData dummy; /* unused */
Tcl_Interp *interp; /* current interpreter */
int objc; /* number of arguments */
Tcl_Obj *CONST objv[]; /* argument objects */
{
if (Initialize(interp) != TCL_OK) {
int result = TCL_OK;
char *token, *head, *tail;
ItclClass *cdefn;
ItclMemberCode *mcode;
ItkClassOptTable *optTable;
Tcl_HashEntry *entry;
ItkClassOption *opt;
Tcl_DString buffer;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "class::option body");
return TCL_ERROR;
}
return Tcl_EvalEx(interp, safeInitScript, -1, 0);
/*
* Parse the member name "namesp::namesp::class::option".
* Make sure that a class name was specified, and that the
* class exists.
*/
token = Tcl_GetStringFromObj(objv[1], (int*)NULL);
Itcl_ParseNamespPath(token, &buffer, &head, &tail);
if (!head || *head == '\0') {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"missing class specifier for body declaration \"", token, "\"",
(char*)NULL);
result = TCL_ERROR;
goto configBodyCmdDone;
}
cdefn = Itcl_FindClass(interp, head, /* autoload */ 1);
if (cdefn == NULL) {
result = TCL_ERROR;
goto configBodyCmdDone;
}
/*
* Look first for a configuration option with that name.
* If it is not found, assume the reference is for a public
* variable, and use the usual "configbody" implementation
* to handle it.
*/
optTable = Itk_FindClassOptTable(cdefn);
opt = NULL;
if (optTable) {
Tcl_DString optName;
Tcl_DStringInit(&optName);
Tcl_DStringAppend(&optName, "-", -1);
Tcl_DStringAppend(&optName, tail, -1);
entry = Tcl_FindHashEntry(&optTable->options,
Tcl_DStringValue(&optName));
if (entry) {
opt = (ItkClassOption*)Tcl_GetHashValue(entry);
}
Tcl_DStringFree(&optName);
}
if (opt == NULL) {
result = Itcl_ConfigBodyCmd(dummy, interp, objc, objv);
goto configBodyCmdDone;
}
/*
* Otherwise, change the implementation for this option.
*/
token = Tcl_GetStringFromObj(objv[2], (int*)NULL);
if (Itcl_CreateMemberCode(interp, cdefn, (char*)NULL, token,
&mcode) != TCL_OK) {
result = TCL_ERROR;
goto configBodyCmdDone;
}
Itcl_PreserveData((ClientData)mcode);
Itcl_EventuallyFree((ClientData)mcode, Itcl_DeleteMemberCode);
if (opt->member->code) {
Itcl_ReleaseData((ClientData)opt->member->code);
}
opt->member->code = mcode;
configBodyCmdDone:
Tcl_DStringFree(&buffer);
return result;
}
+108 -183
View File
@@ -15,23 +15,25 @@
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
*
* RCS: $Id: itk_option.c,v 1.1 1998/07/27 18:45:25 stanton Exp $
* ========================================================================
* 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.
*/
#include "itkInt.h"
#include "itk.h"
/*
* FORWARD DECLARATIONS
*/
static char* ItkTraceClassDestroy (ClientData cdata,
Tcl_Interp *interp, const char *name1, const char *name2, int flags);
static Tcl_HashTable* ItkGetClassesWithOptInfo (
Tcl_Interp *interp);
static void ItkFreeClassesWithOptInfo (ClientData cdata,
Tcl_Interp *interp);
static char* ItkTraceClassDestroy _ANSI_ARGS_((ClientData cdata,
Tcl_Interp *interp, char *name1, char *name2, int flags));
static Tcl_HashTable* ItkGetClassesWithOptInfo _ANSI_ARGS_((
Tcl_Interp *interp));
static void ItkFreeClassesWithOptInfo _ANSI_ARGS_((ClientData cdata,
Tcl_Interp *interp));
/*
@@ -55,73 +57,63 @@ static void ItkFreeClassesWithOptInfo (ClientData cdata,
*/
/* ARGSUSED */
int
Itk_ClassOptionDefineCmd(
ClientData clientData, /* class parser info */
Tcl_Interp *interp, /* current interpreter */
int objc, /* number of arguments */
Tcl_Obj *const objv[]) /* argument objects */
Itk_ClassOptionDefineCmd(clientData, interp, objc, objv)
ClientData clientData; /* class parser info */
Tcl_Interp *interp; /* current interpreter */
int objc; /* number of arguments */
Tcl_Obj *CONST objv[]; /* argument objects */
{
ItclObjectInfo *info = (ItclObjectInfo*)clientData;
ItclClass *iclsPtr = (ItclClass*)Itcl_PeekStack(&info->clsStack);
ItclClass *cdefn = (ItclClass*)Itcl_PeekStack(&info->cdefnStack);
int newEntry;
char *switchName;
char *resName;
char *resClass;
char *init;
char *config;
char *switchName, *resName, *resClass, *init, *config;
ItkClassOptTable *optTable;
Tcl_HashEntry *entry;
ItkClassOption *opt;
ItclShowArgs(1, "Itk_ClassOptionDefineCmd", objc, objv);
/*
* Make sure that the arguments look right. The option switch
* name must start with a '-'.
*/
if (objc < 5 || objc > 6) {
Tcl_WrongNumArgs(interp, 1, objv,
"-switch resourceName resourceClass init ?config?");
"-switch resourceName resourceClass init ?config?");
return TCL_ERROR;
}
switchName = Tcl_GetString(objv[1]);
switchName = Tcl_GetStringFromObj(objv[1], (int*)NULL);
if (*switchName != '-') {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"bad option name \"", switchName, "\": should be -",
switchName, (char*)NULL);
"bad option name \"", switchName, "\": should be -", switchName,
(char*)NULL);
return TCL_ERROR;
}
if (strstr(switchName, ".")) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"bad option name \"", switchName,
"\": illegal character \".\"", (char*)NULL);
"bad option name \"", switchName, "\": illegal character \".\"",
(char*)NULL);
return TCL_ERROR;
}
resName = Tcl_GetString(objv[2]);
resName = Tcl_GetStringFromObj(objv[2], (int*)NULL);
if (!islower((int)*resName)) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"bad resource name \"", resName,
"\": should start with a lower case letter",
(char*)NULL);
"bad resource name \"", resName,
"\": should start with a lower case letter",
(char*)NULL);
return TCL_ERROR;
}
resClass = Tcl_GetString(objv[3]);
resClass = Tcl_GetStringFromObj(objv[3], (int*)NULL);
if (!isupper((int)*resClass)) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"bad resource class \"", resClass,
"\": should start with an upper case letter",
(char*)NULL);
"bad resource class \"", resClass,
"\": should start with an upper case letter",
(char*)NULL);
return TCL_ERROR;
}
if (iclsPtr == NULL) {
Tcl_AppendResult(interp, "can only handle options on class level",
NULL);
return TCL_ERROR;
}
/*
* Make sure that this option has not already been defined in
* the context of this class. Options can be redefined in
@@ -130,14 +122,14 @@ Itk_ClassOptionDefineCmd(
* which option is being referenced if the configuration code
* is redefined by a subsequent "body" command.
*/
optTable = Itk_CreateClassOptTable(interp, iclsPtr);
optTable = Itk_CreateClassOptTable(interp, cdefn);
entry = Tcl_CreateHashEntry(&optTable->options, switchName, &newEntry);
if (!newEntry) {
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"option \"", switchName, "\" already defined in class \"",
Tcl_GetString(iclsPtr->fullNamePtr), "\"",
(char*)NULL);
"option \"", switchName, "\" already defined in class \"",
cdefn->fullname, "\"",
(char*)NULL);
return TCL_ERROR;
}
@@ -145,16 +137,16 @@ Itk_ClassOptionDefineCmd(
* Create a new option record and add it to the table for this
* class.
*/
init = Tcl_GetString(objv[4]);
init = Tcl_GetStringFromObj(objv[4], (int*)NULL);
if (objc == 6) {
config = Tcl_GetString(objv[5]);
config = Tcl_GetStringFromObj(objv[5], (int*)NULL);
} else {
config = NULL;
}
if (Itk_CreateClassOption(interp, iclsPtr, switchName, resName, resClass,
init, config, &opt) != TCL_OK) {
if (Itk_CreateClassOption(interp, cdefn, switchName, resName, resClass,
init, config, &opt) != TCL_OK) {
return TCL_ERROR;
}
@@ -176,18 +168,18 @@ Itk_ClassOptionDefineCmd(
*/
/* ARGSUSED */
int
Itk_ClassOptionIllegalCmd(
ClientData clientData, /* class parser info */
Tcl_Interp *interp, /* current interpreter */
int objc, /* number of arguments */
Tcl_Obj *const objv[]) /* argument objects */
Itk_ClassOptionIllegalCmd(clientData, interp, objc, objv)
ClientData clientData; /* class parser info */
Tcl_Interp *interp; /* current interpreter */
int objc; /* number of arguments */
Tcl_Obj *CONST objv[]; /* argument objects */
{
char *op = Tcl_GetString(objv[0]);
char *op = Tcl_GetStringFromObj(objv[0], (int*)NULL);
Tcl_AppendStringsToObj(Tcl_GetObjResult(interp),
"can only ", op, " options for a specific widget\n",
"(move this command into the constructor)",
(char*)NULL);
"can only ", op, " options for a specific widget\n",
"(move this command into the constructor)",
(char*)NULL);
return TCL_ERROR;
}
@@ -208,80 +200,24 @@ Itk_ClassOptionIllegalCmd(
*/
/* ARGSUSED */
int
Itk_ConfigClassOption(
Tcl_Interp *interp, /* interpreter managing the class */
ItclObject *contextObj, /* object being configured */
ClientData cdata, /* class option */
const char *newval) /* new value for this option */
Itk_ConfigClassOption(interp, contextObj, cdata, newval)
Tcl_Interp *interp; /* interpreter managing the class */
ItclObject *contextObj; /* object being configured */
ClientData cdata; /* class option */
char *newval; /* new value for this option */
{
ItkClassOption *opt = (ItkClassOption*)cdata;
int result = TCL_OK;
ItclMemberCode *mcode;
Tcl_CallFrame frame;
/*
* If the option has any config code, execute it now.
* Make sure that the namespace context is set up correctly.
*/
mcode = opt->codePtr;
if (mcode && mcode->bodyPtr) {
Itcl_PushCallFrame(interp, &frame, opt->iclsPtr->nsPtr, 1);
Itcl_SetContext(interp, contextObj);
result = Tcl_EvalObjEx(interp, mcode->bodyPtr, 0);
Itcl_UnsetContext(interp);
Itcl_PopCallFrame(interp);
/*
* Here we engage in some ugly hackery workaround until
* someone has time to come back and implement this
* properly.
*
* In Itcl/Itk 3, the same machinery was used to implement
* method invocation and configbody invocation, and the
* code here looked like:
*
mcode = opt->member->code;
if (mcode && mcode->procPtr->bodyPtr) {
result = Itcl_EvalMemberCode(interp, (ItclMemberFunc*)NULL,
opt->member, contextObj, 0, (Tcl_Obj**)NULL);
*
* In Itcl 4, Itcl methods have become (a particular variant)
* of TclOO methods. It's not clear whether config bodies
* should also do that, or what?
*
* Instead the existing solution above has been to just "eval"
* the configbody body script in a suitable context, which
* works very nearly correctly. The trouble is that unlike
* method invocation, we've not pushed a proper frame, nor
* have we unwound a return level, so when the "eval" returns
* TCL_RETURN we've not been handling that right. You will
* find some configbody bodies out there that expect to be
* able to use [return] for early exit. Iwidgets test
* Extbutton-2.8 is an example.
*
* As a cheap workaround, we put in explicit special treatment
* for (result == TCL_RETURN) here. This is essentially a
* reproduction of the Tcl internal routine TclUpdateReturnInfo()
* but without the benefit of internals access.
*/
if (result == TCL_RETURN) {
Tcl_Obj *opts = Tcl_GetReturnOptions(interp, TCL_RETURN);
Tcl_Obj *levelKey = Tcl_NewStringObj("-level", -1);
Tcl_Obj *levelObj;
int level;
Tcl_DictObjGet(NULL, opts, levelKey, &levelObj);
Tcl_GetIntFromObj(NULL, levelObj, &level);
Tcl_DictObjPut(NULL, opts, levelKey, Tcl_NewIntObj(--level));
result = Tcl_SetReturnOptions(interp, opts);
Tcl_DecrRefCount(levelKey);
}
}
return result;
}
@@ -306,9 +242,9 @@ Itk_ConfigClassOption(
* ------------------------------------------------------------------------
*/
ItkClassOptTable*
Itk_CreateClassOptTable(
Tcl_Interp *interp, /* interpreter managing the class */
ItclClass *iclsPtr) /* class definition */
Itk_CreateClassOptTable(interp, cdefn)
Tcl_Interp *interp; /* interpreter managing the class */
ItclClass *cdefn; /* class definition */
{
int newEntry, result;
Tcl_HashTable *itkClasses;
@@ -327,7 +263,7 @@ Itk_CreateClassOptTable(
*/
itkClasses = ItkGetClassesWithOptInfo(interp);
entry = Tcl_CreateHashEntry(itkClasses, (char*)iclsPtr, &newEntry);
entry = Tcl_CreateHashEntry(itkClasses, (char*)cdefn, &newEntry);
if (newEntry) {
optTable = (ItkClassOptTable*)ckalloc(sizeof(ItkClassOptTable));
Tcl_InitHashTable(&optTable->options, TCL_STRING_KEYS);
@@ -335,16 +271,17 @@ Itk_CreateClassOptTable(
Tcl_SetHashValue(entry, (ClientData)optTable);
result = Itcl_PushCallFrame(interp, &frame,
iclsPtr->nsPtr, /* isProcCallFrame */ 0);
result = Tcl_PushCallFrame(interp, &frame,
cdefn->namesp, /* isProcCallFrame */ 0);
if (result == TCL_OK) {
Tcl_TraceVar(interp, "_itk_option_data",
(TCL_TRACE_UNSETS | TCL_NAMESPACE_ONLY),
ItkTraceClassDestroy, (ClientData)iclsPtr);
Itcl_PopCallFrame(interp);
(TCL_TRACE_UNSETS | TCL_NAMESPACE_ONLY),
ItkTraceClassDestroy, (ClientData)cdefn);
Tcl_PopCallFrame(interp);
}
} else {
}
else {
optTable = (ItkClassOptTable*)Tcl_GetHashValue(entry);
}
return optTable;
@@ -366,8 +303,8 @@ Itk_CreateClassOptTable(
* ------------------------------------------------------------------------
*/
ItkClassOptTable*
Itk_FindClassOptTable(
ItclClass *iclsPtr) /* class definition */
Itk_FindClassOptTable(cdefn)
ItclClass *cdefn; /* class definition */
{
Tcl_HashTable *itkClasses;
Tcl_HashEntry *entry;
@@ -375,8 +312,8 @@ Itk_FindClassOptTable(
/*
* Look for the specified class definition in the table.
*/
itkClasses = ItkGetClassesWithOptInfo(iclsPtr->interp);
entry = Tcl_FindHashEntry(itkClasses, (char*)iclsPtr);
itkClasses = ItkGetClassesWithOptInfo(cdefn->interp);
entry = Tcl_FindHashEntry(itkClasses, (char*)cdefn);
if (entry) {
return (ItkClassOptTable*)Tcl_GetHashValue(entry);
}
@@ -400,14 +337,14 @@ Itk_FindClassOptTable(
*/
/* ARGSUSED */
static char*
ItkTraceClassDestroy(
ClientData cdata, /* class definition data */
Tcl_Interp *interp, /* interpreter managing the class */
const char *name1, /* name of variable involved in trace */
const char *name2, /* name of array element within variable */
int flags) /* flags describing trace */
ItkTraceClassDestroy(cdata, interp, name1, name2, flags)
ClientData cdata; /* class definition data */
Tcl_Interp *interp; /* interpreter managing the class */
char *name1; /* name of variable involved in trace */
char *name2; /* name of array element within variable */
int flags; /* flags describing trace */
{
ItclClass *iclsPtr = (ItclClass*)cdata;
ItclClass *cdefn = (ItclClass*)cdata;
Tcl_HashTable *itkClasses;
Tcl_HashEntry *entry;
@@ -420,8 +357,8 @@ ItkTraceClassDestroy(
* If it is found, delete all the option records and tear
* down the table.
*/
itkClasses = ItkGetClassesWithOptInfo(interp);
entry = Tcl_FindHashEntry(itkClasses, (char*)iclsPtr);
itkClasses = ItkGetClassesWithOptInfo(cdefn->interp);
entry = Tcl_FindHashEntry(itkClasses, (char*)cdefn);
if (entry) {
optTable = (ItkClassOptTable*)Tcl_GetHashValue(entry);
Tcl_DeleteHashEntry(entry);
@@ -455,15 +392,17 @@ ItkTraceClassDestroy(
* ------------------------------------------------------------------------
*/
int
Itk_CreateClassOption(
Tcl_Interp *interp, /* interpreter managing the class */
ItclClass *iclsPtr, /* class containing this option */
char *switchName, /* name of command-line switch */
char *resName, /* resource name in X11 database */
char *resClass, /* resource class name in X11 database */
char *defVal, /* last-resort default value */
char *config, /* configuration code */
ItkClassOption **optPtr) /* returns: option record */
Itk_CreateClassOption(interp, cdefn, switchName, resName, resClass,
defVal, config, optPtr)
Tcl_Interp *interp; /* interpreter managing the class */
ItclClass *cdefn; /* class containing this option */
char *switchName; /* name of command-line switch */
char *resName; /* resource name in X11 database */
char *resClass; /* resource class name in X11 database */
char *defVal; /* last-resort default value */
char *config; /* configuration code */
ItkClassOption **optPtr; /* returns: option record */
{
ItkClassOption *opt;
ItclMemberCode *mcode;
@@ -473,16 +412,15 @@ Itk_CreateClassOption(
* an implementation for it.
*/
if (config) {
if (Itcl_CreateMemberCode(interp, iclsPtr, (char*)NULL, config,
if (Itcl_CreateMemberCode(interp, cdefn, (char*)NULL, config,
&mcode) != TCL_OK) {
return TCL_ERROR;
}
Itcl_PreserveData((ClientData)mcode);
#ifdef NOTDEF
Itcl_EventuallyFree((ClientData)mcode, (Tcl_FreeProc *)Itcl_DeleteMemberCode);
#endif
} else {
Itcl_EventuallyFree((ClientData)mcode, Itcl_DeleteMemberCode);
}
else {
mcode = NULL;
}
@@ -490,17 +428,8 @@ Itk_CreateClassOption(
* Create the record to represent this option.
*/
opt = (ItkClassOption*)ckalloc(sizeof(ItkClassOption));
memset(opt, 0, sizeof(ItkClassOption));
opt->iclsPtr = iclsPtr;
opt->flags = 0;
opt->protection = Itcl_Protection(interp, 0);
opt->namePtr = Tcl_NewStringObj(switchName, -1);
Tcl_IncrRefCount(opt->namePtr);
opt->fullNamePtr = Tcl_NewStringObj(Tcl_GetString(iclsPtr->fullNamePtr), -1);
Tcl_AppendToObj(opt->fullNamePtr, "::", 2);
Tcl_AppendToObj(opt->fullNamePtr, switchName, -1);
Tcl_IncrRefCount(opt->fullNamePtr);
opt->codePtr = mcode;
opt->member = Itcl_CreateMember(interp, cdefn, switchName);
opt->member->code = mcode;
opt->resName = (char*)ckalloc((unsigned)(strlen(resName)+1));
strcpy(opt->resName, resName);
@@ -530,9 +459,9 @@ Itk_CreateClassOption(
* ------------------------------------------------------------------------
*/
ItkClassOption*
Itk_FindClassOption(
ItclClass *iclsPtr, /* class containing this option */
const char *switchName) /* name of command-line switch */
Itk_FindClassOption(cdefn, switchName)
ItclClass *cdefn; /* class containing this option */
char *switchName; /* name of command-line switch */
{
ItkClassOption *opt = NULL;
@@ -554,7 +483,7 @@ Itk_FindClassOption(
* Look for the option table for the specified class, and check
* for the requested switch.
*/
optTable = Itk_FindClassOptTable(iclsPtr);
optTable = Itk_FindClassOptTable(cdefn);
if (optTable) {
entry = Tcl_FindHashEntry(&optTable->options, switchName);
if (entry) {
@@ -574,12 +503,10 @@ Itk_FindClassOption(
* ------------------------------------------------------------------------
*/
void
Itk_DelClassOption(
ItkClassOption *opt) /* pointer to option data */
Itk_DelClassOption(opt)
ItkClassOption *opt; /* pointer to option data */
{
#ifdef NOTDEF
Itcl_DeleteMember(opt->member);
#endif
ckfree(opt->resName);
ckfree(opt->resClass);
ckfree(opt->init);
@@ -598,8 +525,8 @@ Itk_DelClassOption(
* ------------------------------------------------------------------------
*/
static Tcl_HashTable*
ItkGetClassesWithOptInfo(
Tcl_Interp *interp) /* interpreter handling this registration */
ItkGetClassesWithOptInfo(interp)
Tcl_Interp *interp; /* interpreter handling this registration */
{
Tcl_HashTable* classesTable;
@@ -627,15 +554,13 @@ ItkGetClassesWithOptInfo(
* ------------------------------------------------------------------------
*/
static void
ItkFreeClassesWithOptInfo(
ClientData clientData, /* associated data */
Tcl_Interp *interp) /* interpreter being freed */
ItkFreeClassesWithOptInfo(clientData, interp)
ClientData clientData; /* associated data */
Tcl_Interp *interp; /* interpreter being freed */
{
Tcl_HashTable *tablePtr = (Tcl_HashTable*)clientData;
Tcl_HashSearch place;
Tcl_HashSearch place2;
Tcl_HashEntry *entry;
Tcl_HashEntry *entry2;
Tcl_HashSearch place, place2;
Tcl_HashEntry *entry, *entry2;
ItkClassOptTable *optTable;
ItkClassOption *opt;
+23 -33
View File
@@ -15,13 +15,15 @@
* Bell Labs Innovations for Lucent Technologies
* mmclennan@lucent.com
* http://www.tcltk.com/itcl
*
* RCS: $Id: itk_util.c,v 1.1 1998/07/27 18:45:25 stanton Exp $
* ========================================================================
* 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.
*/
#include "itkInt.h"
#include "itk.h"
/*
@@ -33,9 +35,9 @@
* ------------------------------------------------------------------------
*/
void
Itk_OptListInit(
ItkOptList *olist, /* list to be initialized */
Tcl_HashTable *options) /* table containing the real option entries */
Itk_OptListInit(olist, options)
ItkOptList *olist; /* list to be initialized */
Tcl_HashTable *options; /* table containing the real option entries */
{
olist->options = options;
olist->len = 0;
@@ -56,8 +58,8 @@ Itk_OptListInit(
* ------------------------------------------------------------------------
*/
void
Itk_OptListFree(
ItkOptList *olist) /* list to be freed */
Itk_OptListFree(olist)
ItkOptList *olist; /* list to be freed */
{
ckfree((char*)olist->list);
olist->len = olist->max = 0;
@@ -74,19 +76,13 @@ Itk_OptListFree(
* ------------------------------------------------------------------------
*/
void
Itk_OptListAdd(
ItkOptList *olist, /* ordered list */
Tcl_HashEntry *entry) /* entry to be added to the list */
Itk_OptListAdd(olist, entry)
ItkOptList *olist; /* ordered list */
Tcl_HashEntry *entry; /* entry to be added to the list */
{
int i;
int first;
int last;
int cmp;
int pos;
int size;
int i, first, last, cmp, pos, size;
Tcl_HashEntry** newOrder;
char *swname;
char *optname;
char *swname, *optname;
/*
* Make sure that the option list is big enough. Resize
@@ -95,7 +91,7 @@ Itk_OptListAdd(
if (olist->len >= olist->max) {
size = olist->max*sizeof(Tcl_HashEntry*);
newOrder = (Tcl_HashEntry**)ckalloc((unsigned)2*size);
memcpy((void*)newOrder, (void*)olist->list, (size_t)size);
memcpy((VOID*)newOrder, (VOID*)olist->list, (size_t)size);
ckfree((char*)olist->list);
olist->list = newOrder;
@@ -107,12 +103,11 @@ Itk_OptListAdd(
*/
first = 0;
last = olist->len-1;
swname = ((char *)Tcl_GetHashKey(olist->options, entry)) + 1;
swname = Tcl_GetHashKey(olist->options, entry) + 1;
while (last >= first) {
pos = (first+last)/2;
optname = ((char *)Tcl_GetHashKey(olist->options,
olist->list[pos])) + 1;
optname = Tcl_GetHashKey(olist->options, olist->list[pos]) + 1;
if (*swname == *optname) {
cmp = strcmp(swname, optname);
if (cmp == 0) {
@@ -159,26 +154,21 @@ Itk_OptListAdd(
* ------------------------------------------------------------------------
*/
void
Itk_OptListRemove(
ItkOptList *olist, /* ordered list */
Tcl_HashEntry *entry) /* entry to be removed from the list */
Itk_OptListRemove(olist, entry)
ItkOptList *olist; /* ordered list */
Tcl_HashEntry *entry; /* entry to be removed from the list */
{
int pos = 0;
int i;
int first;
int last;
int cmp;
char *swname;
char *optname;
int i, first, last, cmp;
char *swname, *optname;
first = 0;
last = olist->len-1;
swname = ((char *)Tcl_GetHashKey(olist->options, entry)) + 1;
swname = Tcl_GetHashKey(olist->options, entry) + 1;
while (last >= first) {
pos = (first+last)/2;
optname = ((char *)Tcl_GetHashKey(olist->options,
olist->list[pos])) + 1;
optname = Tcl_GetHashKey(olist->options, olist->list[pos]) + 1;
if (*swname == *optname) {
cmp = strcmp(swname, optname);
if (cmp == 0) {
+17 -10
View File
@@ -45,6 +45,8 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: Archetype.itk,v 1.1 1998/07/27 18:45:26 stanton Exp $
# ----------------------------------------------------------------------
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
# ======================================================================
@@ -54,27 +56,32 @@
itcl::class itk::Archetype {
constructor {args} {
::itcl::builtin::Archetype init
_initOptionInfo
eval itk_initialize $args
}
destructor {
::itcl::builtin::Archetype delete
_deleteOptionInfo
}
method cget {option} @Archetype-cget
method configure {{option ""} args} \
@Archetype-configure
method config {{option ""} args} {
eval configure $option $args
}
method configure {{option ""} args} @Archetype-configure
method component {{name ""} args} \
@Archetype-component
method config {{option ""} args} @Archetype-configure
protected method itk_component {option args} \
@Archetype-itk_component
method component {{name ""} args} @Archetype-component
protected method itk_option {option args} \
@Archetype-itk_option
protected method itk_component {option args} @Archetype-itk_component
protected method itk_option {option args} @Archetype-itk_option
protected method itk_initialize {args} @Archetype-itk_initialize
protected method itk_initialize {args} \
@Archetype-itk_initialize
protected variable itk_option
protected variable itk_component
+4 -13
View File
@@ -23,6 +23,8 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: Toplevel.itk,v 1.1 1998/07/27 18:45:27 stanton Exp $
# ----------------------------------------------------------------------
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
# ======================================================================
@@ -42,9 +44,9 @@ itcl::class itk::Toplevel {
itk_component add hull {
toplevel $itk_hull -class [namespace tail [info class]]
} {
keep -menu -background -cursor -takefocus
keep -background -cursor -takefocus
}
bind itk-delete-$itk_hull <Destroy> [list itcl::delete object $this]
bind itk-delete-$itk_hull <Destroy> "itcl::delete object $this"
set tags [bindtags $itk_hull]
bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull]
@@ -61,17 +63,6 @@ itcl::class itk::Toplevel {
}
destroy $itk_hull
}
itk_component delete hull
set components [component]
foreach component $components {
set path($component) [component $component]
}
foreach component $components {
if {[winfo exists $path($component)]} {
destroy $path($component)
}
}
}
itk_option define -title title Title "" {
+3 -12
View File
@@ -21,6 +21,8 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: Widget.itk,v 1.1 1998/07/27 18:45:28 stanton Exp $
# ----------------------------------------------------------------------
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
# ======================================================================
@@ -45,7 +47,7 @@ itcl::class itk::Widget {
} {
keep -background -cursor
}
bind itk-delete-$itk_hull <Destroy> [list itcl::delete object $this]
bind itk-delete-$itk_hull <Destroy> "itcl::delete object $this"
set tags [bindtags $itk_hull]
bindtags $itk_hull [linsert $tags 0 itk-delete-$itk_hull]
@@ -62,17 +64,6 @@ itcl::class itk::Widget {
}
destroy $itk_hull
}
itk_component delete hull
set components [component]
foreach component $components {
set path($component) [component $component]
}
foreach component $components {
if {[winfo exists $path($component)]} {
destroy $path($component)
}
}
}
private variable itk_hull ""
+6 -22
View File
@@ -8,37 +8,21 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: itk.tcl,v 1.1 1998/07/27 18:45:28 stanton Exp $
# ----------------------------------------------------------------------
# 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 -exact Itk 4.2.3
#
# Provide transparent access to all [incr Tk] commands
#
lappend auto_path ${itk::library}
# ----------------------------------------------------------------------
# USAGE: itk::remove_destroy_hook <widget>
#
# Used internally via "itk_component delete" when disconnecting a
# component <widget> from the mega-widget that contains it.
# Each component has a special binding for the <Destroy> event
# that causes it to disconnect itself from its parent when destroyed.
# This procedure removes the binding from the binding tag list and
# deletes the binding. It is much easier to implement this in
# Tcl than C.
# ----------------------------------------------------------------------
proc ::itk::remove_destroy_hook {widget} {
if {![winfo exists $widget]} {return}
set tags [bindtags $widget]
set i [lsearch $tags "itk-destroy-$widget"]
if {$i >= 0} {
bindtags $widget [lreplace $tags $i $i]
}
bind itk-destroy-$widget <Destroy> {}
if {$tcl_platform(os) == "MacOS"} {
source -rsrc itk:tclIndex
} else {
lappend auto_path ${itk::library}
}
#
+2 -2
View File
@@ -27,7 +27,7 @@ MODIFICATIONS.
GOVERNMENT USE: If you are acquiring this software on behalf of the
U.S. government, the Government shall have only "Restricted Rights"
in the software and related documentation as defined in the Federal
in the software and related documentation as defined in the Federal
Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you
are acquiring the software on behalf of the Department of Defense, the
software shall be classified as "Commercial Computer Software" and the
@@ -35,4 +35,4 @@ Government shall have only "Restricted Rights" as defined in Clause
252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the
authors grant the U.S. Government and others acting in its behalf
permission to use and distribute the software in accordance with the
terms specified in this license.
terms specified in this license.
+73
View File
@@ -0,0 +1,73 @@
/*
* MW_ItkHeader.pch --
*
* This file is the source for a pre-compilied header that gets used
* for all files in the Tk 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-1996 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_TkHeader.pch 1.16 96/09/04 17:01:00
*/
/*
* Support for automatically naming the precompiled header file ...
*/
#if __POWERPC__
#pragma precompile_target "MW_ItkHeaderPPC"
#include "MW_TkHeaderPPC"
#elif __CFM68K__
#pragma precompile_target "MW_ItkHeaderCFM68K"
#include "MW_TkHeaderCFM68K"
#else
#pragma precompile_target "MW_ItkHeader68K"
#include "MW_TkHeader68K"
#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
#include <tcl.h>
#include <tk.h>
#include <itcl.h>
/*
* 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 "itk.h"
#pragma export reset
File diff suppressed because it is too large Load Diff
+94
View File
@@ -0,0 +1,94 @@
/*
* tkMacLibrary.r --
*
* This file creates resources for use in most Tk applications.
* This is designed to be an example of using the Tcl/Tk
* libraries in a Macintosh Application.
*
* Copyright (c) 1996 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: @(#) tkMacLibrary.r 1.5 96/10/03 17:54:21
*/
#include <Types.r>
#include <SysTypes.r>
#include <AEUserTermTypes.r>
/*
* The folowing include and defines help construct
* the version string for Tcl.
*/
#define RESOURCE_INCLUDED
#include <tcl.h>
#include <tk.h>
#include "itcl.h"
#include "itk.h"
#if (TK_RELEASE_LEVEL == 0)
# define RELEASE_LEVEL alpha
#elif (TK_RELEASE_LEVEL == 1)
# define RELEASE_LEVEL beta
#elif (TK_RELEASE_LEVEL == 2)
# define RELEASE_LEVEL final
#endif
#if (TK_RELEASE_LEVEL == 2)
# define MINOR_VERSION (ITCL_MINOR_VERSION * 16) + TK_RELEASE_SERIAL
#else
# define MINOR_VERSION ITCL_MINOR_VERSION * 16
#endif
#define RELEASE_CODE 0x00
#define ITCL_LIBRARY_RESOURCES 3000
#define ITK_LIBRARY_RESOURCES 3500
resource 'vers' (1) {
ITCL_MAJOR_VERSION, MINOR_VERSION,
RELEASE_LEVEL, 0x00, verUS,
ITK_PATCH_LEVEL,
ITK_PATCH_LEVEL ", by Michael McLennan © 1993-1998" "\n" "Lucent Technologies, Inc."
};
resource 'vers' (2) {
ITCL_MAJOR_VERSION, MINOR_VERSION,
RELEASE_LEVEL, 0x00, verUS,
ITK_PATCH_LEVEL,
"ItkWish " ITK_PATCH_LEVEL " © 1993-1998"
};
#define ITCL_LIBRARY_RESOURCES 2000
#define ITK_LIBRARY_RESOURCES 3500
/*
* The -16397 string will be displayed by Finder when a user
* tries to open the shared library. The string should
* give the user a little detail about the library's capabilities
* and enough information to install the library in the correct location.
* A similar string should be placed in all shared libraries.
*/
resource 'STR ' (-16397, purgeable) {
"Itk Library\n\n"
"This is the library needed to run add Itcl to the Tcl/Tk shell. "
"To work properly, it should be placed in the ŒTool Command Language¹ folder "
"within the Extensions folder."
};
/*
* We now load the Tk library into the resource fork of the library.
*/
#include "itkMacTclCode.r"
read 'TEXT' (ITK_LIBRARY_RESOURCES+12, "itk:tclIndex", purgeable)
"::mac:tclIndex";
data 'TEXT' (ITK_LIBRARY_RESOURCES+13,"pkgIndex",purgeable, preload) {
"# Tcl package index file, version 1.0\n"
"package ifneeded Itk 3.1 [list package require Itcl 3.1 \; load [file join $dir itk31[info sharedlibextension]] Itk \; source -rsrc itk:tclIndex]\n"
};
+1376
View File
File diff suppressed because it is too large Load Diff
+29
View File
@@ -0,0 +1,29 @@
/*
* itkMacTclCode.r
*
* This file includes the Itk code that is needed to startup Itk.
* It is to be included either in the resource fork of the shared library, or in the
* resource fork of the application for a statically bound application.
*
* Jim Ingham
* Lucent Technologies 1996
*
*/
#define ITK_LIBRARY_RESOURCES 3500
/*
* We now load the Itk library into the resource fork of the application.
*/
read 'TEXT' (ITK_LIBRARY_RESOURCES+1, "itk", purgeable)
"::library:itk.tcl";
read 'TEXT' (ITK_LIBRARY_RESOURCES+3, "Itk_Archetype", purgeable)
"::library:Archetype.itk";
read 'TEXT' (ITK_LIBRARY_RESOURCES+4, "Itk_Widget", purgeable)
"::library:Widget.itk";
read 'TEXT' (ITK_LIBRARY_RESOURCES+5, "Itk_Toplevel", purgeable)
"::library:Toplevel.itk";
+29
View File
@@ -0,0 +1,29 @@
/*
* itkStaticApplication.r --
*
* This file creates resources which bind in the static version of the
* pkgIndex tclIndex and itk's Tcl code files.
*
* Jim Ingham for Itcl 2.2
*
* Copyright (c) 1996 Lucent Technologies
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* SCCS: @(#) itkStaticApplication.r 1.5 96/10/03 17:54:21
*/
#include <Types.r>
#include <SysTypes.r>
#define ITK_LIBRARY_RESOURCES 3500
#include "itkMacTclCode.r"
data 'TEXT' (ITK_LIBRARY_RESOURCES+6,"itk:pkgIndex",purgeable, preload) {
"# Tcl package index file, version 1.0\n"
"package ifneeded Itk 2.2 {load {} Itk}\n"
};
read 'TEXT' (ITK_LIBRARY_RESOURCES+2, "Itk:tclIndex", purgeable)
"::mac:tclIndex";
+3
View File
@@ -0,0 +1,3 @@
# Tcl package index file, version 1.0
package ifneeded Itk 3.1 [list load [file join $dir itk31[info sharedlibextension]] Itk]
+11
View File
@@ -0,0 +1,11 @@
# Tcl autoload index file, version 2.0
# This file is generated by the "auto_mkindex" command
# and sourced to set up indexing information for one or
# more commands. Typically each line is a command that
# sets an element in the auto_index array, where the
# element name is the name of a command and the value is
# a script that loads the command.
set auto_index(::itk::Archetype) [list source -rsrc Itk_Archetype]
set auto_index(::itk::Toplevel) [list source -rsrc Itk_Toplevel]
set auto_index(::itk::Widget) [list source -rsrc Itk_Widget]
+418
View File
@@ -0,0 +1,418 @@
/*
* tkMacAppInit.c --
*
* Provides a version of the Tcl_AppInit procedure for the example shell.
*
* Copyright (c) 1993-1994 Lockheed Missle & Space Company, AI Center
* 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: @(#) tkMacAppInit.c 1.35 97/07/28 11:18:55
*/
#include <Gestalt.h>
#include <ToolUtils.h>
#include <Fonts.h>
#include <Dialogs.h>
#include <SegLoad.h>
#include <Traps.h>
#include <Appearance.h>
#include "tk.h"
#include "tkInt.h"
#include "tkMacInt.h"
#include "tclMac.h"
#include "itk.h"
/* include tclInt.h for access to namespace API */
#include "tclInt.h"
#ifdef TK_TEST
EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
#endif /* TK_TEST */
#ifdef TCL_TEST
EXTERN int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
#endif /* TCL_TEST */
Tcl_Interp *gStdoutInterp = NULL;
int TkMacConvertEvent _ANSI_ARGS_((EventRecord *eventPtr));
/*
* Prototypes for functions the ANSI library needs to link against.
*/
short InstallConsole _ANSI_ARGS_((short fd));
void RemoveConsole _ANSI_ARGS_((void));
long WriteCharsToConsole _ANSI_ARGS_((char *buff, long n));
long ReadCharsFromConsole _ANSI_ARGS_((char *buff, long n));
extern char * __ttyname _ANSI_ARGS_((long fildes));
short SIOUXHandleOneEvent _ANSI_ARGS_((EventRecord *event));
/*
* Prototypes for functions from the tkConsole.c file.
*/
EXTERN void TkConsoleCreate _ANSI_ARGS_((void));
EXTERN int TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN void TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
int devId, char *buffer, long size));
/*
* Forward declarations for procedures defined later in this file:
*/
static int MacintoshInit _ANSI_ARGS_((void));
static int SetupMainInterp _ANSI_ARGS_((Tcl_Interp *interp));
/*
*----------------------------------------------------------------------
*
* main --
*
* Main program for Wish.
*
* Results:
* None. This procedure never returns (it exits the process when
* it's done
*
* Side effects:
* This procedure initializes the wish world and then
* calls Tk_Main.
*
*----------------------------------------------------------------------
*/
void
main(
int argc, /* Number of arguments. */
char **argv) /* Array of argument strings. */
{
char *newArgv[2];
if (MacintoshInit() != TCL_OK) {
Tcl_Exit(1);
}
argc = 1;
newArgv[0] = "itkwish";
newArgv[1] = NULL;
Tk_Main(argc, newArgv, Tcl_AppInit);
}
/*
*----------------------------------------------------------------------
*
* Tcl_AppInit --
*
* This procedure performs application-specific initialization.
* Most applications, especially those that incorporate additional
* packages, will have their own version of this procedure.
*
* Results:
* Returns a standard Tcl completion code, and leaves an error
* message in interp->result if an error occurs.
*
* Side effects:
* Depends on the startup script.
*
*----------------------------------------------------------------------
*/
int
Tcl_AppInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
if (Tcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
/*
* Call the init procedures for included packages. Each call should
* look like this:
*
* if (Mod_Init(interp) == TCL_ERROR) {
* return TCL_ERROR;
* }
*
* where "Mod" is the name of the module.
*/
#ifdef TCL_TEST
if (Tcltest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
(Tcl_PackageInitProc *) NULL);
if (TclObjTest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
#endif /* TCL_TEST */
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
(Tcl_PackageInitProc *) NULL);
#endif /* TK_TEST */
/*
* Call Tcl_CreateCommand for application-specific commands, if
* they weren't already created by the init procedures called above.
* Each call would look like this:
*
* Tcl_CreateCommand(interp, "tclName", CFuncCmd, NULL, NULL);
*/
if (Itcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
if (Itk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Itcl", Itcl_Init, Itcl_SafeInit);
Tcl_StaticPackage(interp, "Itk", Itk_Init, (Tcl_PackageInitProc *) NULL);
/*
* This is itkwish, so import all [incr Tcl] commands by
* default into the global namespace. Fix up the autoloader
* to do the same.
*/
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
"::itk::*", /* allowOverwrite */ 1) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
"::itcl::*", /* allowOverwrite */ 1) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::itcl::* ::itk::* }") != TCL_OK) {
return TCL_ERROR;
}
SetupMainInterp(interp);
/*
* Specify a user-specific startup script to invoke if the application
* is run interactively. On the Mac we can specifiy either a TEXT resource
* which contains the script or the more UNIX like file location
* may also used. (I highly recommend using the resource method.)
*/
Tcl_SetVar(interp, "tcl_rcRsrcName", "itkwishrc", TCL_GLOBAL_ONLY);
/* Tcl_SetVar(interp, "tcl_rcFileName", "~/.itkwishrc", TCL_GLOBAL_ONLY); */
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* MacintoshInit --
*
* This procedure calls Mac specific initilization calls. Most of
* these calls must be made as soon as possible in the startup
* process.
*
* Results:
* Returns TCL_OK if everything went fine. If it didn't the
* application should probably fail.
*
* Side effects:
* Inits the application.
*
*----------------------------------------------------------------------
*/
static int
MacintoshInit()
{
int i;
long result, mask = 0x0700; /* mask = system 7.x */
#if GENERATING68K && !GENERATINGCFM
SetApplLimit(GetApplLimit() - (TK_MAC_68K_STACK_GROWTH));
#endif
MaxApplZone();
for (i = 0; i < 4; i++) {
(void) MoreMasters();
}
/*
* Tk needs us to set the qd pointer it uses. This is needed
* so Tk doesn't have to assume the availablity of the qd global
* variable. Which in turn allows Tk to be used in code resources.
*/
tcl_macQdPtr = &qd;
/*
* If appearance is present, then register Tk as an Appearance client
* This means that the mapping from non-Appearance to Appearance cdefs
* will be done for Tk regardless of the setting in the Appearance
* control panel.
*/
if (TkMacHaveAppearance()) {
RegisterAppearanceClient();
}
InitGraf(&tcl_macQdPtr->thePort);
InitFonts();
InitWindows();
InitMenus();
InitDialogs((long) NULL);
InitCursor();
/*
* Make sure we are running on system 7 or higher
*/
if ((NGetTrapAddress(_Gestalt, ToolTrap) ==
NGetTrapAddress(_Unimplemented, ToolTrap))
|| (((Gestalt(gestaltSystemVersion, &result) != noErr)
|| (result < mask)))) {
panic("Tcl/Tk requires System 7 or higher.");
}
/*
* Make sure we have color quick draw
* (this means we can't run on 68000 macs)
*/
if (((Gestalt(gestaltQuickdrawVersion, &result) != noErr)
|| (result < gestalt32BitQD13))) {
panic("Tk requires Color QuickDraw.");
}
FlushEvents(everyEvent, 0);
SetEventMask(everyEvent);
Tcl_MacSetEventProc(TkMacConvertEvent);
TkConsoleCreate();
return TCL_OK;
}
/*
*----------------------------------------------------------------------
*
* SetupMainInterp --
*
* This procedure calls initalization routines require a Tcl
* interp as an argument. This call effectively makes the passed
* iterpreter the "main" interpreter for the application.
*
* Results:
* Returns TCL_OK if everything went fine. If it didn't the
* application should probably fail.
*
* Side effects:
* More initilization.
*
*----------------------------------------------------------------------
*/
static int
SetupMainInterp(
Tcl_Interp *interp)
{
/*
* Initialize the console only if we are running as an interactive
* application.
*/
TkMacInitAppleEvents(interp);
TkMacInitMenus(interp);
if (strcmp(Tcl_GetVar(interp, "tcl_interactive", TCL_GLOBAL_ONLY), "1")
== 0) {
if (TkConsoleInit(interp) == TCL_ERROR) {
goto error;
}
}
/*
* Attach the global interpreter to tk's expected global console
*/
gStdoutInterp = interp;
return TCL_OK;
error:
panic(interp->result);
return TCL_ERROR;
}
/*
*----------------------------------------------------------------------
*
* InstallConsole, RemoveConsole, etc. --
*
* The following functions provide the UI for the console package.
* Users wishing to replace SIOUX with their own console package
* need only provide the four functions below in a library.
*
* Results:
* See SIOUX documentation for details.
*
* Side effects:
* See SIOUX documentation for details.
*
*----------------------------------------------------------------------
*/
short
InstallConsole(short fd)
{
#pragma unused (fd)
return 0;
}
void
RemoveConsole(void)
{
}
long
WriteCharsToConsole(char *buffer, long n)
{
TkConsolePrint(gStdoutInterp, TCL_STDOUT, buffer, n);
return n;
}
long
ReadCharsFromConsole(char *buffer, long n)
{
return 0;
}
extern char *
__ttyname(long fildes)
{
static char *__devicename = "null device";
if (fildes >= 0 && fildes <= 2) {
return (__devicename);
}
return (0L);
}
short
SIOUXHandleOneEvent(EventRecord *event)
{
return 0;
}
+2 -14
View File
@@ -1,15 +1,3 @@
# -*- tcl -*-
# Tcl package index file, version 1.1
#
# Tcl package index file, version 1.0
if {![package vsatisfies [package provide Tcl] 8.6-]} {return}
if {[string length [package provide Itcl]] && ![package vsatisfies [package provide Itcl] 4.1]} return
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded itk @PACKAGE_VERSION@ \
[list load [file join $dir @PKG_LIB_FILE9@] Itk]
} else {
package ifneeded itk @PACKAGE_VERSION@ \
[list load [file join $dir @PKG_LIB_FILE8@] Itk]
}
package ifneeded Itk @PACKAGE_VERSION@ [list package require -exact itk @PACKAGE_VERSION@]
package ifneeded Itk @VERSION@ [list load [file join $dir @RELPATH@ "@itk_LIB_FILE@"] Itk]
+16
View File
@@ -0,0 +1,16 @@
# This file contains a top-level script to run all of the Tcl
# tests. Execute it by invoking "source all" when running tclTest
# in this directory.
#
# SCCS: @(#) all 1.7 96/02/16 08:55:38
foreach i [lsort [glob *.test]] {
if [string match l.*.test $i] {
# This is an SCCS lock file; ignore it.
continue
}
puts stdout $i
if [catch {source $i} msg] {
puts $msg
}
}
-18
View File
@@ -1,18 +0,0 @@
# 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.
package prefer latest
package require Tcl 8.6-
package require tcltest 2.2
tcltest::configure {*}$argv -testdir [file dir [info script]]
tcltest::runAllTests
return
+343
View File
@@ -0,0 +1,343 @@
# This file contains support code for the Tcl test suite. It is
# normally sourced by the individual files in the test suite before
# they run their tests. This improved approach to testing was designed
# and initially implemented by Mary Ann May-Pumphrey of Sun Microsystems.
#
# Copyright (c) 1990-1994 The Regents of the University of California.
# Copyright (c) 1994-1996 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: @(#) defs 1.44 96/10/08 17:26:58
if ![info exists VERBOSE] {
set VERBOSE 0
}
if ![info exists TESTS] {
set TESTS {}
}
# If tests are being run as root, issue a warning message and set a
# variable to prevent some tests from running at all.
set user {}
if {$tcl_platform(platform) == "unix"} {
catch {set user [exec whoami]}
if {$user == ""} {
catch {regexp {^[^(]*\(([^)]*)\)} [exec id] dummy user}
}
if {$user == ""} {set user root}
if {$user == "root"} {
puts stdout "Warning: you're executing as root. I'll have to"
puts stdout "skip some of the tests, since they'll fail as root."
}
}
# Some of the tests don't work on some system configurations due to
# differences in word length, file system configuration, etc. In order
# to prevent false alarms, these tests are generally only run in the
# master development directory for Tcl. The presence of a file
# "doAllTests" in this directory is used to indicate that the non-portable
# tests should be run.
set doNonPortableTests [file exists doAllTests]
# If there is no "memory" command (because memory debugging isn't
# enabled), generate a dummy command that does nothing.
if {[info commands memory] == ""} {
proc memory args {}
}
# Check configuration information that will determine which tests
# to run. To do this, create an array testConfig. Each element
# has a 0 or 1 value, and the following elements are defined:
# unixOnly - 1 means this is a UNIX platform, so it's OK
# to run tests that only work under UNIX.
# macOnly - 1 means this is a Mac platform, so it's OK
# to run tests that only work on Macs.
# pcOnly - 1 means this is a PC platform, so it's OK to
# run tests that only work on PCs.
# unixOrPc - 1 means this is a UNIX or PC platform.
# macOrPc - 1 means this is a Mac or PC platform.
# macOrUnix - 1 means this is a Mac or UNIX platform.
# nonPortable - 1 means this the tests are being running in
# the master Tcl/Tk development environment;
# Some tests are inherently non-portable because
# they depend on things like word length, file system
# configuration, window manager, etc. These tests
# are only run in the main Tcl development directory
# where the configuration is well known. The presence
# of the file "doAllTests" in this directory indicates
# that it is safe to run non-portable tests.
# tempNotPc - The inverse of pcOnly. This flag is used to
# temporarily disable a test.
# nonBlockFiles - 1 means this platform supports setting files into
# nonblocking mode.
# asyncPipeClose- 1 means this platform supports async flush and
# async close on a pipe.
# unixExecs - 1 means this machine has commands such as 'cat',
# 'echo' etc available.
catch {unset testConfig}
if {$tcl_platform(platform) == "unix"} {
set testConfig(unixOnly) 1
set testConfig(tempNotPc) 1
} else {
set testConfig(unixOnly) 0
}
if {$tcl_platform(platform) == "macintosh"} {
set testConfig(tempNotPc) 1
set testConfig(macOnly) 1
} else {
set testConfig(macOnly) 0
}
if {$tcl_platform(platform) == "windows"} {
set testConfig(pcOnly) 1
} else {
set testConfig(pcOnly) 0
}
set testConfig(unixOrPc) [expr $testConfig(unixOnly) || $testConfig(pcOnly)]
set testConfig(macOrPc) [expr $testConfig(macOnly) || $testConfig(pcOnly)]
set testConfig(macOrUnix) [expr $testConfig(macOnly) || $testConfig(unixOnly)]
set testConfig(nonPortable) [file exists doAllTests]
set f [open defs r]
if {[expr [catch {fconfigure $f -blocking off}]] == 0} {
set testConfig(nonBlockFiles) 1
} else {
set testConfig(nonBlockFiles) 0
}
close $f
# Test for SCO Unix - cannot run async flushing tests because a potential
# problem with select is apparently interfering. (Mark Diekhans).
if {$tcl_platform(platform) == "unix"} {
if {[catch {exec uname -X | fgrep {Release = 3.2v}}] == 0} {
set testConfig(asyncPipeClose) 0
} else {
set testConfig(asyncPipeClose) 1
}
} else {
set testConfig(asyncPipeClose) 1
}
# Test to see if execed commands such as cat, echo, rm and so forth are
# present on this machine.
set testConfig(unixExecs) 1
if {$tcl_platform(platform) == "macintosh"} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && ($tcl_platform(platform) == "windows")} {
if {[catch {exec cat defs}] == 1} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && ([catch {exec echo hello}] == 1)} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && \
([catch {exec sh -c echo hello}] == 1)} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && ([catch {exec wc defs}] == 1)} {
set testConfig(unixExecs) 0
}
if {$testConfig(unixExecs) == 1} {
exec echo hello > removeMe
if {[catch {exec rm removeMe}] == 1} {
set testConfig(unixExecs) 0
}
}
if {($testConfig(unixExecs) == 1) && ([catch {exec sleep 1}] == 1)} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && \
([catch {exec fgrep unixExecs defs}] == 1)} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && ([catch {exec ps}] == 1)} {
set testConfig(unixExecs) 0
}
if {($testConfig(unixExecs) == 1) && \
([catch {exec echo abc > removeMe}] == 0) && \
([catch {exec chmod 644 removeMe}] == 1) && \
([catch {exec rm removeMe}] == 0)} {
set testConfig(unixExecs) 0
} else {
catch {exec rm -f removeMe}
}
if {($testConfig(unixExecs) == 1) && \
([catch {exec mkdir removeMe}] == 1)} {
set testConfig(unixExecs) 0
} else {
catch {exec rm -r removeMe}
}
if {$testConfig(unixExecs) == 0} {
puts stdout "Warning: Unix-style executables are not available, so"
puts stdout "some tests will be skipped."
}
}
proc print_verbose {name description script code answer} {
puts stdout "\n"
puts stdout "==== $name $description"
puts stdout "==== Contents of test case:"
puts stdout "$script"
if {$code != 0} {
if {$code == 1} {
puts stdout "==== Test generated error:"
puts stdout $answer
} elseif {$code == 2} {
puts stdout "==== Test generated return exception; result was:"
puts stdout $answer
} elseif {$code == 3} {
puts stdout "==== Test generated break exception"
} elseif {$code == 4} {
puts stdout "==== Test generated continue exception"
} else {
puts stdout "==== Test generated exception $code; message was:"
puts stdout $answer
}
} else {
puts stdout "==== Result was:"
puts stdout "$answer"
}
}
# test --
# This procedure runs a test and prints an error message if the
# test fails. If VERBOSE has been set, it also prints a message
# even if the test succeeds. The test will be skipped if it
# doesn't match the TESTS variable, or if one of the elements
# of "constraints" turns out not to be true.
#
# Arguments:
# name - Name of test, in the form foo-1.2.
# description - Short textual description of the test, to
# help humans understand what it does.
# constraints - A list of one or more keywords, each of
# which must be the name of an element in
# the array "testConfig". If any of these
# elements is zero, the test is skipped.
# This argument may be omitted.
# script - Script to run to carry out the test. It must
# return a result that can be checked for
# correctness.
# answer - Expected result from script.
proc test {name description script answer args} {
global VERBOSE TESTS testConfig
if {[string compare $TESTS ""] != 0} then {
set ok 0
foreach test $TESTS {
if [string match $test $name] then {
set ok 1
break
}
}
if !$ok then return
}
set i [llength $args]
if {$i == 0} {
# Empty body
} elseif {$i == 1} {
# "constraints" argument exists; shuffle arguments down, then
# make sure that the constraints are satisfied.
set constraints $script
set script $answer
set answer [lindex $args 0]
foreach constraint $constraints {
if {![info exists testConfig($constraint)]
|| !$testConfig($constraint)} {
return
}
}
} else {
error "wrong # args: must be \"test name description ?constraints? script answer\""
}
memory tag $name
set code [catch {uplevel $script} result]
if {$code != 0} {
print_verbose $name $description $script \
$code $result
} elseif {[string compare $result $answer] == 0} then {
if $VERBOSE then {
if {$VERBOSE > 0} {
print_verbose $name $description $script \
$code $result
}
puts stdout "++++ $name PASSED"
}
} else {
print_verbose $name $description $script \
$code $result
puts stdout "---- Result should have been:"
puts stdout "$answer"
puts stdout "---- $name FAILED"
}
}
proc dotests {file args} {
global TESTS
set savedTests $TESTS
set TESTS $args
source $file
set TESTS $savedTests
}
proc normalizeMsg {msg} {
regsub "\n$" [string tolower $msg] "" msg
regsub -all "\n\n" $msg "\n" msg
regsub -all "\n\}" $msg "\}" msg
return $msg
}
proc makeFile {contents name} {
set fd [open $name w]
fconfigure $fd -translation lf
if {[string index $contents [expr [string length $contents] - 1]] == "\n"} {
puts -nonewline $fd $contents
} else {
puts $fd $contents
}
close $fd
}
proc removeFile {name} {
file delete $name
}
proc makeDirectory {name} {
file mkdir $name
}
proc removeDirectory {name} {
file delete -force $name
}
proc viewFile {name} {
global tcl_platform testConfig
if {($tcl_platform(platform) == "macintosh") || \
($testConfig(unixExecs) == 0)} {
set f [open $name]
set data [read -nonewline $f]
close $f
return $data
} else {
exec cat $name
}
}
# Locate tcltest executable
set tcltest [list [info nameofexecutable]]
if {$tcltest == "{}"} {
set tcltest {}
puts "Unable to find tcltest executable, multiple process tests will fail."
}
+7 -13
View File
@@ -5,17 +5,15 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: interp.test,v 1.1 1998/07/27 18:45:31 stanton Exp $
# ----------------------------------------------------------------------
# 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::*
::tcltest::loadTestedCommands
if {[string compare test [info procs test]] == 1} then {source defs}
# ----------------------------------------------------------------------
# Make sure that slave interpreters can be created and loaded
@@ -29,14 +27,13 @@ test interp-1.1 {create a slave interp with [incr Tk]} {
list [slave eval "namespace children :: ::itk"] [interp delete slave]
} {::itk {}}
test interp-1.2 {can load [incr Tk] into a safe interp} {
safe::interpCreate slave
safe::loadTk slave
test interp-1.2 {can't load [incr Tk] into a safe interp} {
interp create -safe slave
load "" Itcl slave
set result [list [catch {load "" Itk slave} msg] $msg]
safe::interpDelete slave
interp delete slave
set result
} {0 {}}
} {1 {can't use package in a safe interpreter: no Itk_SafeInit procedure}}
test interp-1.3 {errors are okay when slave interp is deleted} {
interp create slave
@@ -49,6 +46,3 @@ test interp-1.3 {errors are okay when slave interp is deleted} {
}
interp delete slave
} {}
::tcltest::cleanupTests
exit
+6 -11
View File
@@ -5,17 +5,15 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: option.test,v 1.1 1998/07/27 18:45:32 stanton Exp $
# ----------------------------------------------------------------------
# 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::*
::tcltest::loadTestedCommands
if {[string compare test [info procs test]] == 1} then {source defs}
# ----------------------------------------------------------------------
# Component option processing
@@ -117,15 +115,15 @@ test option-2.1 {create a widget for the following tests} {
} {.testUsual}
test option-2.2 {register some "usual" code} {
itk::usual TestOptComp-test {keep -cursor -foreground}
usual TestOptComp-test {keep -cursor -foreground}
} {}
test option-2.3 {query back "usual" code} {
itk::usual TestOptComp-test
usual TestOptComp-test
} {keep -cursor -foreground}
test option-2.4 {query back unknown "usual" code} {
itk::usual xyzzyxyzzy
usual xyzzyxyzzy
} {}
test option-2.5 {add a component using "usual" code} {
@@ -179,6 +177,3 @@ foreach widget {button canvas checkbutton entry frame label listbox
# Clean up
# ----------------------------------------------------------------------
itcl::delete class TestOptComp TestOptWidget
::tcltest::cleanupTests
exit
+3 -8
View File
@@ -5,17 +5,15 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: privacy.test,v 1.1 1998/07/27 18:45:32 stanton Exp $
# ----------------------------------------------------------------------
# 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::*
::tcltest::loadTestedCommands
if {[string compare test [info procs test]] == 1} then {source defs}
# ----------------------------------------------------------------------
# Define a base class with public variables and a simple mega-widget
@@ -94,6 +92,3 @@ test privacy-1.7 {components are visible depending on namespace context} {
# Clean up
# ----------------------------------------------------------------------
itcl::delete class TestPrivacy TestMorePrivacy
::tcltest::cleanupTests
exit
+3 -8
View File
@@ -5,17 +5,15 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: public.test,v 1.1 1998/07/27 18:45:32 stanton Exp $
# ----------------------------------------------------------------------
# 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::*
::tcltest::loadTestedCommands
if {[string compare test [info procs test]] == 1} then {source defs}
# ----------------------------------------------------------------------
# Define a base class with public variables and a simple mega-widget
@@ -75,6 +73,3 @@ test public-1.4 {config code gets fired off} {
# Clean up
# ----------------------------------------------------------------------
itcl::delete class TestPublic test_public_base
::tcltest::cleanupTests
exit
+4 -126
View File
@@ -5,17 +5,15 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: toplevel.test,v 1.1 1998/07/27 18:45:33 stanton Exp $
# ----------------------------------------------------------------------
# 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::*
::tcltest::loadTestedCommands
if {[string compare test [info procs test]] == 1} then {source defs}
# ----------------------------------------------------------------------
# Toplevel mega-widget
@@ -54,7 +52,7 @@ test toplevel-1.1 {define a toplevel mega-widget class} {
test toplevel-1.2 {check the list of configuration options} {
.testToplevel0 configure
} {{-background background Background linen linen} {-clientdata clientData ClientData {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-menu menu Menu {} {}} {-takefocus takeFocus TakeFocus 0 0} {-text text Text {} {}} {-title title Title {} {}}}
} {{-background background Background linen linen} {-clientdata clientData ClientData {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-takefocus takeFocus TakeFocus 0 0} {-text text Text {} {}} {-title title Title {} {}}}
test toplevel-1.3 {check the list components} {
lsort [.testToplevel0 component]
@@ -76,127 +74,7 @@ test toplevel-1.6 {when a mega-widget is destroyed, its object is deleted} {
itcl::find objects .testToplevel*
} {}
test toplevel-1.7 {when an mega-widget object is deleted, its window and any
components are destroyed } {
TestToplevel .delme
set label [.delme component test1]
itcl::delete object .delme
list [winfo exists .delme] [winfo exists $label]
} {0 0}
test toplevel-1.8 {when a mega-widget object is deleted, its window and any
components are destroyed (even if in another window) } {
catch {destroy .t1}
catch {destroy .t2}
catch {rename .t2 {}}
catch {itcl::delete class ButtonTop}
itcl::class ButtonTop {
inherit itk::Toplevel
constructor {args} {
eval itk_initialize $args
itk_component add button {
button $itk_option(-container).b -text Button
} {}
pack $itk_component(button)
}
itk_option define -container container Container {}
}
toplevel .t1
ButtonTop .t2 -container .t1
set button [.t2 component button]
itcl::delete object .t2
set result [list $button [winfo exists $button]]
itcl::delete class ButtonTop
destroy .t1
set result
} {.t1.b 0}
test toplevel-1.9 {when a window that contains a megawidget component
is destroyed, the component is removed from the megawidget} {
catch {destroy .t1}
catch {destroy .t2}
catch {rename .t2 {}}
catch {itcl::delete class ButtonTop}
itcl::class ButtonTop {
inherit itk::Toplevel
constructor {args} {
eval itk_initialize $args
itk_component add button {
button $itk_option(-container).b -text Button
} {}
pack $itk_component(button)
}
itk_option define -container container Container {}
}
toplevel .t1
ButtonTop .t2 -container .t1
set result [list [.t2 component]]
destroy .t1
lappend result [list [.t2 component]]
itcl::delete object .t2
itcl::delete class ButtonTop
set result
} {{button hull} hull}
test toplevel-1.10 {when destroying a component that is inside another
window protect against that case where one component destroy
actually destroys other contained components} {
catch {destroy .t1}
catch {destroy .t2}
catch {rename .t2 {}}
catch {itcl::delete class ButtonTop}
itcl::class ButtonTop {
inherit itk::Toplevel
constructor {args} {
eval itk_initialize $args
# Note, the component names matter here since
# [.t2 component] returns names in hash order.
# We need to delete cframe first since it
# is the parent of cbutton.
itk_component add cframe {
button $itk_option(-container).cframe
} {}
pack $itk_component(cframe)
itk_component add cbutton {
button $itk_component(cframe).b -text Button
} {}
pack $itk_component(cbutton)
}
itk_option define -container container Container {}
}
toplevel .t1
ButtonTop .t2 -container .t1
set result [list [.t2 component]]
# destructor should destroy cframe but not cbutton
itcl::delete object .t2
lappend result [winfo exists .t1.cframe]
destroy .t1
itcl::delete class ButtonTop
set result
} {{hull cframe cbutton} 0}
# ----------------------------------------------------------------------
# Clean up
# ----------------------------------------------------------------------
itcl::delete class TestToplevel
::tcltest::cleanupTests
exit
+6 -156
View File
@@ -5,17 +5,15 @@
# Bell Labs Innovations for Lucent Technologies
# mmclennan@lucent.com
# http://www.tcltk.com/itcl
#
# RCS: $Id: widget.test,v 1.1 1998/07/27 18:45:33 stanton Exp $
# ----------------------------------------------------------------------
# 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::*
::tcltest::loadTestedCommands
if {[string compare test [info procs test]] == 1} then {source defs}
# ----------------------------------------------------------------------
# Simple mega-widget
@@ -159,7 +157,7 @@ test widget-1.10 {check the invocation of "config" code} {
} {{} {test message}}
test widget-1.11a {configure using the "code" command} {
.testWidget0 do {configure -command [itcl::code $this action "button press"]}
.testWidget0 do {configure -command [code $this action "button press"]}
.testWidget0 cget -command
} {namespace inscope ::TestWidget {::.testWidget0 action {button press}}}
@@ -206,7 +204,7 @@ test widget-1.16 {dead components are removed from the component list} {
} {hull test1 test2}
test widget-1.17 {use "configbody" command to change "config" code} {
itcl::configbody TestWidget::status {lappend status "new"}
configbody TestWidget::status {lappend status "new"}
} {}
test widget-1.18 {"config" code can really change} {
@@ -217,7 +215,7 @@ test widget-1.18 {"config" code can really change} {
} {new new}
test widget-1.19 {"config" code can change back} {
itcl::configbody TestWidget::status {lappend status $itk_option(-status)}
configbody TestWidget::status {lappend status $itk_option(-status)}
} {}
test widget-1.20 {mega-widgets show up on the object list} {
@@ -239,155 +237,7 @@ test widget-1.23 {when an object is deleted the widget is destroyed} {
winfo exists .testWidget0
} {0}
test widget-1.24 {recreate another test widget} {
TestWidget .testWidget
} {.testWidget}
test widget-1.25 {when an internal component is destroyed, it is removed from the list of components, and any dead options disappear} {
list [lsort [.testWidget component]] \
[.testWidget configure] \
[catch {destroy [.testWidget component test1]}] \
[.testWidget component] \
[.testWidget do {return [lsort [array names itk_component]]}] \
[.testWidget configure]
} {{hull test1 test2} {{-background background Background linen linen} {-borderwidth borderWidth BorderWidth 2 2} {-clientdata clientData ClientData {} {}} {-command command Command {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-highlight highlight Foreground white white} {-normal normal Background ivory ivory} {-status status Status {} {}} {-text text Text {} {}}} 0 {hull test2} {hull test2} {{-background background Background linen linen} {-borderwidth borderWidth BorderWidth 2 2} {-clientdata clientData ClientData {} {}} {-command command Command {} {}} {-cursor cursor Cursor {} {}} {-foreground foreground Foreground navy navy} {-highlight highlight Foreground white white} {-normal normal Background ivory ivory} {-status status Status {} {}}}}
test widget-1.26 {when an internal component is deleted (but not destroyed) it is disconnected from the option list and its binding tags are updated} {
set comp [.testWidget component test2]
list [bindtags $comp] \
[bind itk-destroy-$comp <Destroy>] \
[catch {.testWidget do {itk_component delete test2}}] \
[bindtags $comp] \
[bind itk-destroy-$comp <Destroy>] \
[.testWidget configure]
} {{itk-destroy-.testWidget.t2 .testWidget.t2 Button . all} {namespace inscope ::TestWidget {::.testWidget itk_component delete test2}} 0 {.testWidget.t2 Button . all} {} {{-background background Background linen linen} {-clientdata clientData ClientData {} {}} {-cursor cursor Cursor {} {}} {-status status Status {} {}}}}
test widget-1.27 {when a mega-widget object is deleted, its window and any
components are destroyed (even if in another window) } {
catch {destroy .t1}
catch {rename .t1.bw {}}
catch {itcl::delete class ButtonWidget}
itcl::class ButtonWidget {
inherit itk::Widget
constructor {args} {
eval itk_initialize $args
itk_component add button {
button $itk_option(-container).b -text Button
} {}
pack $itk_component(button)
}
itk_option define -container container Container {}
}
toplevel .t1
frame .t1.f
ButtonWidget .t1.bw -container .t1.f
pack .t1.f
pack .t1.bw
set button [.t1.bw component button]
itcl::delete object .t1.bw
set result [list $button [winfo exists $button]]
destroy .t1
itcl::delete class ButtonWidget
set result
} {.t1.f.b 0}
test widget-1.28 {when a window that contains a megawidget component
is destroyed, the component is removed from the megawidget} {
catch {destroy .t1}
catch {rename .t1.bw {}}
catch {itcl::delete class ButtonWidget}
itcl::class ButtonWidget {
inherit itk::Widget
constructor {args} {
eval itk_initialize $args
itk_component add button {
button $itk_option(-container).b -text Button
} {}
pack $itk_component(button)
}
itk_option define -container container Container {}
}
toplevel .t1
frame .t1.f
ButtonWidget .t1.bw -container .t1.f
pack .t1.f
pack .t1.bw
set result [list [.t1.bw component]]
destroy .t1.f
lappend result [list [.t1.bw component]]
itcl::delete object .t1.bw
destroy .t1
itcl::delete class ButtonWidget
set result
} {{button hull} hull}
test widget-1.29 {when destroying a component that is inside another
window protect against that case where one component destroy
actually destroys other contained components} {
catch {destroy .t1}
catch {rename .t1.bw {}}
catch {itcl::delete class ButtonWidget}
itcl::class ButtonWidget {
inherit itk::Widget
constructor {args} {
eval itk_initialize $args
# Note, the component names matter here since
# [.t2 component] returns names in hash order.
# We need to delete cframe first since it
# is the parent of cbutton.
itk_component add cframe {
button $itk_option(-container).cframe
} {}
pack $itk_component(cframe)
itk_component add cbutton {
button $itk_component(cframe).b -text Button
} {}
pack $itk_component(cbutton)
}
itk_option define -container container Container {}
}
toplevel .t1
frame .t1.f
ButtonWidget .t1.bw -container .t1.f
pack .t1.f
pack .t1.bw
set result [list [.t1.bw component]]
# destructor should destroy cframe but not cbutton
itcl::delete object .t1.bw
lappend result [winfo exists .t1.f.cframe]
destroy .t1
itcl::delete class ButtonWidget
set result
} {{hull cframe cbutton} 0}
# ----------------------------------------------------------------------
# Clean up
# ----------------------------------------------------------------------
itcl::delete class TestWidget
::tcltest::cleanupTests
exit
+357
View File
@@ -0,0 +1,357 @@
#
# This file is a Makefile for [incr Tk]. 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.
#
# RCS: $Id: Makefile.in,v 1.4 1999/08/21 17:05:46 matt Exp $
# Current [incr Tcl] version; used in various names.
MAJOR_VERSION = @ITCL_MAJOR_VERSION@
MINOR_VERSION = @ITCL_MINOR_VERSION@
RELEASE_LEVEL = @ITCL_RELEASE_LEVEL@
VERSION = @ITCL_VERSION@
#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------
# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix). The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.
prefix = @prefix@
exec_prefix = @exec_prefix@
# The following definition can be set to non-null for special systems
# like AFS with replication. It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time. INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =
# Directory from which applications will reference the library of Tcl
# scripts (note: you can set the ITK_LIBRARY environment variable at
# run-time to override the compiled-in location):
ITK_LIBRARY = $(prefix)/lib/itk$(VERSION)
# Path name to use when installing library scripts:
SCRIPT_INSTALL_DIR = $(INSTALL_ROOT)$(ITK_LIBRARY)
# Directory in which to install the archive libitk.a:
LIB_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/lib
# Path to use at runtime to refer to LIB_INSTALL_DIR:
LIB_RUNTIME_DIR = $(exec_prefix)/lib
# Directory in which to install the program wish:
BIN_INSTALL_DIR = $(INSTALL_ROOT)$(exec_prefix)/bin
# Directory in which to install the include file itk.h:
INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/include
# Top-level directory for manual entries:
MAN_INSTALL_DIR = $(INSTALL_ROOT)$(prefix)/man
# Directory in which to install manual entry for wish:
MAN1_INSTALL_DIR = $(MAN_INSTALL_DIR)/man1
# Directory in which to install manual entries for Tk's C library
# procedures:
MAN3_INSTALL_DIR = $(MAN_INSTALL_DIR)/man3
# Directory in which to install manual entries for the built-in
# Tcl commands implemented by Tk:
MANN_INSTALL_DIR = $(MAN_INSTALL_DIR)/mann
# The directory containing the Tcl sources and headers appropriate
# for this version of [incr Tk]:
TCL_SRC_DIR = @TCL_SRC_DIR@
# The directory containing the Tcl library archive file appropriate
# for this version of [incr Tk]:
TCL_LIB_DIR = @TCL_LIB_DIR@
# Library flags for Tcl library
TCL_LIB_FLAG = @TCL_LIB_FLAG@
# Tcl libraries built with optimization switches have this additional extension
DBGX = @TCL_DBGX@
# The directory containing the Tk sources and headers appropriate
# for this version of [incr Tk]:
TK_SRC_DIR = @TK_SRC_DIR@
# The directory containing the Tk library archive file appropriate
# for this version of [incr Tk]:
TK_LIB_DIR = @TK_LIB_DIR@
# Library flags for Tk library
TK_LIB_FLAG = @TK_LIB_FLAG@
# The directory containing the [incr Tcl] sources and headers appropriate
# for this version of [incr Tk]:
ITCL_SRC_DIR = @ITCL_SRC_DIR@
# The directory containing the [incr Tcl] library archive file appropriate
# for this version of [incr Tk]:
ITCL_LIB_DIR = @ITCL_LIB_DIR@
# A "-I" switch that can be used when compiling to make all of the
# X11 include files accessible (the configure script will try to
# set this value, and will cause it to be an empty string if the
# include files are accessible via /usr/include).
X11_INCLUDES = @TK_XINCLUDES@
# Linker switch(es) to use to link with the X11 library archive (the
# configure script will try to set this value automatically, but you
# can override it).
X11_LIB_SWITCHES = @TK_XLIBSW@
# Libraries to use when linking: must include at least Tk, Tcl, Xlib,
# and the math library (in that order). The "LIBS" part will be
# replaced (or has already been replaced) with relevant libraries as
# determined by the configure script.
EXE_LIBS = @TK_BUILD_LIB_SPEC@ $(X11_LIB_SWITCHES) \
@ITCL_BUILD_LIB_SPEC@ @TCL_BUILD_LIB_SPEC@ \
@TCL_LIBS@ @DL_LIBS@ -lc
LIBS = @TK_BUILD_STUB_LIB_SPEC@ $(X11_LIB_SWITCHES) \
@ITCL_BUILD_LIB_SPEC@ @TCL_BUILD_STUB_LIB_SPEC@ \
@TCL_LIBS@ @DL_LIBS@ -lc
# To change the compiler switches, for example to change from -O
# to -g, change the following line:
CFLAGS = @CFLAGS@
# To disable ANSI-C procedure prototypes reverse the comment characters
# on the following lines:
PROTO_FLAGS =
#PROTO_FLAGS = -DNO_PROTOTYPE
# To enable memory debugging reverse the comment characters on the following
# lines. Warning: if you enable memory debugging, you must do it
# *everywhere*, including all the code that calls Tcl, and you must use
# ckalloc and ckfree everywhere instead of malloc and free.
MEM_DEBUG_FLAGS =
#MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG
# If your X server is X11R4 or earlier, then you may wish to reverse
# the comment characters on the following two lines. This will enable
# extra code to speed up XStringToKeysym. In X11R5 and later releases
# XStringToKeysym is plenty fast, so you needn't define REDO_KEYSYM_LOOKUP.
KEYSYM_FLAGS =
#KEYSYM_FLAGS = -DREDO_KEYSYM_LOOKUP
# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL = /bin/sh
# Tk used to let the configure script choose which program to use
# for installing, but there are just too many different versions of
# "install" around; better to use the install-sh script that comes
# with the distribution, which is slower but guaranteed to work.
INSTALL = $(TOP_DIR)/../config/install-sh -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
MKINSTALLDIRS = $(TOP_DIR)/../config/mkinstalldirs
# The symbols below provide support for dynamic loading and shared
# libraries. The values of the symbols are normally set by the
# configure script. You shouldn't normally need to modify any of
# these definitions by hand.
SHLIB_CFLAGS = @SHLIB_CFLAGS@
LD_SEARCH_FLAGS = @LD_SEARCH_FLAGS@
ITK_LIB_FILE = @ITK_LIB_FILE@
#ITK_LIB_FILE = libitk.a
ITK_STUB_LIB_FILE = @ITK_STUB_LIB_FILE@
#ITK_LIB_FILE = libitkstub.a
# The symbol below provides support for dynamic loading and shared
# libraries. See configure.in for a description of what it means.
# The values of the symbolis normally set by the configure script.
SHLIB_LD = @SHLIB_LD@
#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in. You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------
AC_FLAGS = @TCL_DEFS@
RANLIB = @RANLIB@
TOP_DIR = @ITK_SRC_DIR@
GENERIC_DIR = $(TOP_DIR)/generic
UNIX_DIR = $(TOP_DIR)/unix
#----------------------------------------------------------------
# The information below should be usable as is. The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------
CC = @CC@
EXE_CC_SWITCHES = $(CFLAGS) $(SHLIB_CFLAGS) -I$(UNIX_DIR) -I$(GENERIC_DIR) \
-I$(TCL_SRC_DIR)/generic -I$(ITCL_SRC_DIR)/generic \
-I$(TK_SRC_DIR)/generic $(X11_INCLUDES) \
$(AC_FLAGS) $(PROTO_FLAGS) $(MEM_DEBUG_FLAGS) $(KEYSYM_FLAGS) \
-DITK_LIBRARY=\"$(ITK_LIBRARY)\"
CC_SWITCHES = $(EXE_CC_SWITCHES) @TCL_STUB_FLAGS@
OBJS = itkStubInit.o itk_cmds.o itk_option.o itk_archetype.o itk_util.o
ITK_STUB_LIB_OBJS = itkStubLib.o
SRCS = $(GENERIC_DIR)/itk_cmds.c $(GENERIC_DIR)/itk_option.c \
$(GENERIC_DIR)/itk_archetype.c $(GENERIC_DIR)/itk_util.c \
$(GENERIC_DIR)/itkStubInit.c $(GENERIC_DIR)/itkStubLib.c
all: itkwish
# The following target is configured by autoconf to generate either
# a shared library or non-shared library for [incr Tk].
@ITK_LIB_FILE@: ${OBJS}
rm -f $(ITK_LIB_FILE)
@MAKE_LIB@
$(RANLIB) $(ITK_LIB_FILE)
itkwish: tkAppInit.o $(ITK_LIB_FILE) $(ITK_STUB_LIB_FILE)
$(CC) @LD_FLAGS@ tkAppInit.o @ITK_BUILD_LIB_SPEC@ \
$(EXE_LIBS) $(LD_SEARCH_FLAGS) -o itkwish
$(ITK_STUB_LIB_FILE): $(ITCL_STUB_LIB_OBJS)
rm -f $(ITK_STUB_LIB_FILE)
@MAKE_STUB_LIB@
$(RANLIB) $(ITCL_STUB_LIB_FILE)
# Note, in the target below TCL_LIBRARY needs to be set or else
# "make test" won't work in the case where the compilation directory
# isn't the same as the source directory.
test: itkwish
TCLLIBPATH="`pwd` $(TK_LIB_DIR) $(ITCL_LIB_DIR) $(TCL_LIB_DIR)"; export TCLLIBPATH; \
LD_LIBRARY_PATH=`pwd`:$(ITCL_LIB_DIR):$(TK_LIB_DIR):$(TCL_LIB_DIR):$(LD_LIBRARY_PATH); export LD_LIBRARY_PATH; \
TCL_LIBRARY=$(TCL_SRC_DIR)/library; export TCL_LIBRARY; \
TK_LIBRARY=$(TK_SRC_DIR)/library; export TK_LIBRARY; \
ITCL_LIBRARY=$(ITCL_SRC_DIR)/library; export ITCL_LIBRARY; \
ITK_LIBRARY=$(TOP_DIR)/library; export ITK_LIBRARY; \
( echo cd $(TOP_DIR)/tests\; source all\; exit ) \
| ./itkwish -geometry +0+0
install: install-binaries install-libraries install-man
install-binaries: $(ITK_LIB_FILE) $(ITK_STUB_LIB_FILE) itkwish
@$(MKINSTALLDIRS) $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR)
@echo "Installing $(ITK_LIB_FILE)"
@$(INSTALL_DATA) $(ITK_LIB_FILE) $(LIB_INSTALL_DIR)
@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(ITK_LIB_FILE))
@chmod 555 $(LIB_INSTALL_DIR)/$(ITK_LIB_FILE)
@echo "Installing $(ITK_STUB_LIB_FILE)"
@$(INSTALL_DATA) $(ITK_STUB_LIB_FILE) $(LIB_INSTALL_DIR)
@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(ITK_STUB_LIB_FILE))
@chmod 555 $(LIB_INSTALL_DIR)/$(ITK_STUB_LIB_FILE)
@echo "Installing itkwish"
$(INSTALL_PROGRAM) itkwish $(BIN_INSTALL_DIR)/itkwish$(VERSION)
@echo "Installing itkConfig.sh"
@$(INSTALL_DATA) itkConfig.sh $(LIB_INSTALL_DIR)/itkConfig.sh
install-libraries:
@$(MKINSTALLDIRS) $(INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR)
@echo "Installing itk.h"
@$(INSTALL_DATA) $(GENERIC_DIR)/itk.h $(INCLUDE_INSTALL_DIR)
@for i in $(TOP_DIR)/library/*.* $(TOP_DIR)/library/tclIndex $(UNIX_DIR)/tkAppInit.c; \
do \
echo "Installing $$i"; \
$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
done;
@echo "Installing pkgIndex.tcl"
@$(INSTALL_DATA) pkgIndex.tcl $(SCRIPT_INSTALL_DIR)
install-man:
@$(MKINSTALLDIRS) $(MAN1_INSTALL_DIR) $(MANN_INSTALL_DIR)
@cd $(TOP_DIR)/doc; for i in *.1; \
do \
echo "Installing doc/$$i"; \
rm -f $(MAN1_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
$$i > $(MAN1_INSTALL_DIR)/$$i; \
chmod 444 $(MAN1_INSTALL_DIR)/$$i; \
done;
@cd $(TOP_DIR)/doc; for i in *.n; \
do \
echo "Installing doc/$$i"; \
rm -f $(MANN_INSTALL_DIR)/$$i; \
sed -e '/man\.macros/r man.macros' -e '/man\.macros/d' \
$$i > $(MANN_INSTALL_DIR)/$$i; \
chmod 444 $(MANN_INSTALL_DIR)/$$i; \
done;
Makefile: $(UNIX_DIR)/Makefile.in
$(SHELL) config.status
genstubs:
tclsh $(TOOL_DIR)/genStubs.tcl $(GENERIC_DIR) \
$(GENERIC_DIR)/itk.decls $(GENERIC_DIR)/itkInt.decls
clean:
rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors \
rm -f itkwish* libitk* *pure* *% ../tests/core
distclean: clean
rm -f Makefile config.status config.log config.cache pkgIndex.tcl
pure: tkAppInit.o $(ITK_LIB_FILE)
purify $(CC) @LD_FLAGS@ tkAppInit.o @ITK_BUILD_LIB_SPEC@ \
$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish.pure
profile: tkAppInit.o $(ITK_LIB_FILE)
quantify $(CC) @LD_FLAGS@ tkAppInit.o @ITK_BUILD_LIB_SPEC@ \
$(LIBS) $(LD_SEARCH_FLAGS) -o itkwish.pure
depend:
makedepend -- $(CC_SWITCHES) -- $(SRCS)
configure: configure.in
autoconf
.c.o:
$(CC) -c $(CC_SWITCHES) $<
tkAppInit.o: $(UNIX_DIR)/tkAppInit.c Makefile
$(CC) -c $(EXE_CC_SWITCHES) $(UNIX_DIR)/tkAppInit.c
itkStubInit.o: $(GENERIC_DIR)/itkStubInit.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itkStubInit.c
itkStubLib.o: $(GENERIC_DIR)/itkStubLib.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itkStubLib.c
itk_cmds.o: $(GENERIC_DIR)/itk_cmds.c Makefile
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_cmds.c
itk_option.o: $(GENERIC_DIR)/itk_option.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_option.c
itk_archetype.o: $(GENERIC_DIR)/itk_archetype.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_archetype.c
itk_util.o: $(GENERIC_DIR)/itk_util.c
$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/itk_util.c
# DO NOT DELETE THIS LINE -- make depend depends on it.
+266
View File
@@ -0,0 +1,266 @@
dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tk installation
dnl to configure the system for the local environment.
AC_INIT(../generic/itk.h)
# RCS: $Id: configure.in,v 1.5 1999/06/28 18:47:35 hershey Exp $
ITCL_VERSION=3.1
ITCL_MAJOR_VERSION=3
ITCL_MINOR_VERSION=1
ITCL_RELEASE_LEVEL=0
VERSION=${ITCL_VERSION}
AC_CONFIG_AUX_DIR(../../config)
AC_PREREQ(2.0)
# -----------------------------------------------------------------------
# Set up a new default --prefix. If a previous installation of
# [incr Tcl] can be found searching $PATH use that directory.
# -----------------------------------------------------------------------
AC_PREFIX_DEFAULT(/usr/local)
AC_PREFIX_PROGRAM(tclsh)
if test "${prefix}" = "NONE"; then
prefix=/usr/local
fi
if test "${exec_prefix}" = "NONE"; then
exec_prefix=$prefix
fi
AC_PROG_INSTALL
AC_PROG_RANLIB
# -----------------------------------------------------------------------
BUILD_DIR=`pwd`
ITK_SRC_DIR=`cd $srcdir/..; pwd`
cd ${BUILD_DIR}
AC_ARG_ENABLE(gcc, [ --enable-gcc allow use of gcc if available],
[itk_ok=$enableval], [itk_ok=no])
if test "$itk_ok" = "yes"; then
AC_PROG_CC
else
CC=${CC-cc}
AC_SUBST(CC)
fi
#--------------------------------------------------------------------
# See if there was a command-line option for where Tcl is; if
# not, search for Tcl.
#--------------------------------------------------------------------
AC_ARG_WITH(tcl, [ --with-tcl=DIR use Tcl 8.0 binaries from DIR],
itcl_search=$withval, itcl_search=`cd ../../..; ls -d \`pwd\`/tcl8.*/unix`)
TCL_LIB_DIR=""
for dir in $itcl_search $exec_prefix/lib ; do
if test -r $dir/tclConfig.sh; then
TCL_LIB_DIR=$dir
break
fi
done
if test -z "$TCL_LIB_DIR"; then
AC_MSG_ERROR(Can't find Tcl libraries. Use --with-tcl to specify the directory containing tclConfig.sh on your system.)
fi
#--------------------------------------------------------------------
# Read in configuration information generated by Tcl for shared
# libraries, and arrange for it to be substituted into our
# Makefile.
#--------------------------------------------------------------------
file=$TCL_LIB_DIR/tclConfig.sh
. $file
CFLAGS=$TCL_CFLAGS
SHLIB_CFLAGS=$TCL_SHLIB_CFLAGS
SHLIB_LD=$TCL_SHLIB_LD
SHLIB_LD_LIBS=$TCL_SHLIB_LD_LIBS
SHLIB_SUFFIX=$TCL_SHLIB_SUFFIX
DL_LIBS=$TCL_DL_LIBS
LD_FLAGS=$TCL_LD_FLAGS
LD_SEARCH_FLAGS=$TCL_LD_SEARCH_FLAGS
#--------------------------------------------------------------------
# Make sure that we can find the Tcl sources, so we can include
# the "tclInt.h" file.
#--------------------------------------------------------------------
if test ! -d "$TCL_SRC_DIR"; then
AC_MSG_ERROR(Can't find Tcl source directory "$TCL_SRC_DIR". Itcl can't be built without this directory.)
fi
#--------------------------------------------------------------------
# See if there was a command-line option for where Tk is; if
# not, search for Tk.
#--------------------------------------------------------------------
AC_ARG_WITH(tk, [ --with-tk=DIR use Tk 8.0 binaries from DIR],
itcl_search=$withval, itcl_search=`cd ../../..; ls -d \`pwd\`/tk8.*/unix`)
TK_LIB_DIR=""
for dir in $itcl_search $exec_prefix/lib ; do
if test -r $dir/tkConfig.sh; then
TK_LIB_DIR=$dir
break
fi
done
if test -z "$TK_LIB_DIR"; then
AC_MSG_ERROR(Can't find Tk libraries. Use --with-tk to specify the directory containing tkConfig.sh on your system.)
fi
file=$TK_LIB_DIR/tkConfig.sh
. $file
#--------------------------------------------------------------------
# See if there was a command-line option for where [incr Tcl] is.
# If not, assume that its top-level directory is a sibling of ours.
#--------------------------------------------------------------------
AC_ARG_WITH(itcl, [ --with-itcl=DIR use Itcl binaries from DIR],
ITCL_LIB_DIR=$withval, ITCL_LIB_DIR=`cd ../../itcl/unix; pwd`)
if test ! -r "$ITCL_LIB_DIR/itclConfig.sh"; then
AC_MSG_ERROR(Can't find Itcl libraries. Have you built Itcl yet? Use --with-itcl to specify the directory containing itclConfig.sh on your system.)
fi
file=$ITCL_LIB_DIR/itclConfig.sh
. $file
#--------------------------------------------------------------------
# If this is gcc, add some extra compile flags.
#--------------------------------------------------------------------
AC_MSG_CHECKING([whether C compiler is gcc])
AC_CACHE_VAL(itcl_cv_prog_gcc,
AC_EGREP_CPP(_cc_is_gcc_, [
#ifdef __GNUC__
_cc_is_gcc_
#endif
], [itcl_cv_prog_gcc=yes], [itcl_cv_prog_gcc=no]))
AC_MSG_RESULT([$itcl_cv_prog_gcc])
if test -z "$CFLAGS" ; then
CFLAGS="-O"
fi
if test "$itcl_cv_prog_gcc" = "yes" ; then
CFLAGS="$CFLAGS -Wall -Wconversion -Wno-implicit-int"
fi
AC_MSG_CHECKING([default compiler flags])
AC_ARG_WITH(cflags, [ --with-cflags=FLAGS set compiler flags to FLAGS],
[CFLAGS="$with_cflags"])
AC_MSG_RESULT([$CFLAGS])
if test "$TCL_CC" != "$CC" ; then
echo ""
echo "WARNING: Compiler is $CC but Tcl was compiled with $TCL_CC"
echo ""
fi
#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# building libitk as a shared library instead of a static library.
#--------------------------------------------------------------------
AC_ARG_ENABLE(shared,
[ --enable-shared build libitk as a shared library],
[ok=$enableval], [ok=yes])
if test "$ok" = "yes"; then
if test ${TCL_SHARED_BUILD} = 0; then
AC_MSG_ERROR(Tcl was not built with --enable-shared, so you can't use shared libraries.)
fi
SHLIB_CFLAGS="${SHLIB_CFLAGS}"
TCL_STUB_FLAGS=-DUSE_TCL_STUBS
eval "ITK_LIB_FILE=libitk${VERSION}${SHLIB_SUFFIX}"
ITK_PKG_FILE="[[file join [file dirname \$dir] ${ITK_LIB_FILE}]]"
MAKE_LIB="\$(SHLIB_LD) -o ${ITK_LIB_FILE} \$(OBJS) ${SHLIB_LD_LIBS}"
RANLIB=":"
else
SHLIB_CFLAGS=""
TCL_STUB_FLAGS=""
eval "ITK_LIB_FILE=libitk${VERSION}.a"
ITK_PKG_FILE=""
MAKE_LIB="ar cr ${ITK_LIB_FILE} \${OBJS}"
fi
eval "STUB_LIB_FILE=libitkstub${TCL_UNSHARED_LIB_SUFFIX}"
MAKE_STUB_LIB="ar cr \${ITK_STUB_LIB_FILE} \${ITK_STUB_LIB_OBJS}"
ITK_STUB_LIB_FILE=${STUB_LIB_FILE}
# Note: in the following variable, it's important to use the absolute
# path name of the Tcl directory rather than "..": this is because
# AIX remembers this path and will attempt to use it at run-time to look
# up the Tcl library.
if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
ITK_BUILD_LIB_SPEC="-L`pwd` -litk${VERSION}"
ITK_LIB_SPEC="-L${exec_prefix}/lib -litk${VERSION}"
else
ITK_BUILD_LIB_SPEC="-L`pwd` -litk`echo ${VERSION} | tr -d .`"
ITK_LIB_SPEC="-L${exec_prefix}/lib -litk`echo ${VERSION} | tr -d .`"
fi
ITK_BUILD_STUB_LIB_SPEC="-L`pwd` -litkstub${VERSION}"
ITK_STUB_LIB_SPEC="-L${exec_prefix}/lib -litkstub${VERSION}"
AC_SUBST(CFLAGS)
AC_SUBST(DL_LIBS)
AC_SUBST(LD_FLAGS)
AC_SUBST(MAKE_LIB)
AC_SUBST(MAKE_STUB_LIB)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(LD_SEARCH_FLAGS)
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_SRC_DIR)
AC_SUBST(TCL_LIB_SPEC)
AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
AC_SUBST(TCL_BUILD_LIB_SPEC)
AC_SUBST(TCL_STUB_FLAGS)
AC_SUBST(TCL_LIB_FLAG)
AC_SUBST(TCL_DBGX)
AC_SUBST(TCL_DEFS)
AC_SUBST(TCL_LIBS)
AC_SUBST(TCL_SHLIB_LD_LIBS)
AC_SUBST(TCL_SHLIB_SUFFIX)
AC_SUBST(TCL_COMPAT_OBJS)
AC_SUBST(TK_VERSION)
AC_SUBST(TK_BUILD_LIB_SPEC)
AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
AC_SUBST(TK_LIB_DIR)
AC_SUBST(TK_LIB_SPEC)
AC_SUBST(TK_LIB_FLAG)
AC_SUBST(TK_XINCLUDES)
AC_SUBST(TK_XLIBSW)
AC_SUBST(TK_SRC_DIR)
AC_SUBST(ITCL_VERSION)
AC_SUBST(ITCL_MAJOR_VERSION)
AC_SUBST(ITCL_MINOR_VERSION)
AC_SUBST(ITCL_RELEASE_LEVEL)
AC_SUBST(ITCL_BUILD_LIB_SPEC)
AC_SUBST(ITCL_LIB_DIR)
AC_SUBST(ITCL_LIB_SPEC)
AC_SUBST(ITCL_PKG_FILE)
AC_SUBST(ITCL_SRC_DIR)
AC_SUBST(ITK_BUILD_LIB_SPEC)
AC_SUBST(ITK_LIB_FILE)
AC_SUBST(ITK_LIB_SPEC)
AC_SUBST(ITK_BUILD_STUB_LIB_SPEC)
AC_SUBST(ITK_STUB_LIB_FILE)
AC_SUBST(ITK_STUB_LIB_SPEC)
AC_SUBST(ITK_PKG_FILE)
AC_SUBST(ITK_SRC_DIR)
AC_OUTPUT(Makefile pkgIndex.tcl itkConfig.sh)
+47
View File
@@ -0,0 +1,47 @@
# itkConfig.sh --
#
# This shell script (for sh) is generated automatically by Itk's
# configure script. It will create shell variables for most of
# the configuration options discovered by the configure script.
# This script is intended to be included by the configure scripts
# for Itk extensions so that they don't have to figure this all
# out for themselves. This file does not duplicate information
# already provided by tclConfig.sh, tkConfig.sh or itclConfig.sh,
# so you may need to use those files in addition to this one.
#
# The information in this file is specific to a single platform.
# Itcl's version number.
ITCL_VERSION='3.1'
ITCL_MAJOR_VERSION='3'
ITCL_MINOR_VERSION='1'
# The name of the Itk library (may be either a .a file or a shared library):
ITK_LIB_FILE=libitk3.1.so
# String to pass to linker to pick up the Itk library from its
# build directory.
ITK_BUILD_LIB_SPEC='-L/home/hershey/cvs/itcl3.1.0/itk/unix -litk3.1'
# String to pass to linker to pick up the Itk library from its
# installed directory.
ITK_LIB_SPEC='-L/home/hershey/cvs/lib -litk3.1'
# The name of the Itk stub library (a .a file):
ITK_STUB_LIB_FILE=libitkstub3.1.a
# String to pass to linker to pick up the Itk stub library from its
# build directory.
ITK_BUILD_STUB_LIB_SPEC='-L/home/hershey/cvs/itcl3.1.0/itk/unix -litkstub3.1'
# String to pass to linker to pick up the Itk stub library from its
# installed directory.
ITK_STUB_LIB_SPEC='-L/home/hershey/cvs/lib -litkstub3.1'
# Location of the top-level source directories from which [incr Tk]
# was built. This is the directory that contains a README file as well
# as subdirectories such as generic, unix, etc. If [incr Tk] was
# compiled in a different place than the directory containing the source
# files, this points to the location of the sources, not the location
# where [incr Tk] was compiled.
ITK_SRC_DIR='/home/hershey/cvs/itcl3.1.0/itk'
+10 -8
View File
@@ -1,5 +1,5 @@
# itkConfig.sh --
#
#
# This shell script (for sh) is generated automatically by Itk's
# configure script. It will create shell variables for most of
# the configuration options discovered by the configure script.
@@ -13,28 +13,30 @@
# Itcl's version number.
ITCL_VERSION='@ITCL_VERSION@'
ITCL_MAJOR_VERSION='@ITCL_MAJOR_VERSION@'
ITCL_MINOR_VERSION='@ITCL_MINOR_VERSION@'
# The name of the Itk library (may be either a .a file or a shared library):
ITK_LIB_FILE=@itk_LIB_FILE@
ITK_LIB_FILE=@ITK_LIB_FILE@
# String to pass to linker to pick up the Itk library from its
# build directory.
ITK_BUILD_LIB_SPEC='@itk_BUILD_LIB_SPEC@'
ITK_BUILD_LIB_SPEC='@ITK_BUILD_LIB_SPEC@'
# String to pass to linker to pick up the Itk library from its
# installed directory.
ITK_LIB_SPEC='@itk_LIB_SPEC@'
ITK_LIB_SPEC='@ITK_LIB_SPEC@'
# The name of the Itk stub library (a .a file):
ITK_STUB_LIB_FILE=@itk_STUB_LIB_FILE@
ITK_STUB_LIB_FILE=@ITK_STUB_LIB_FILE@
# String to pass to linker to pick up the Itk stub library from its
# build directory.
ITK_BUILD_STUB_LIB_SPEC='@itk_BUILD_STUB_LIB_SPEC@'
ITK_BUILD_STUB_LIB_SPEC='@ITK_BUILD_STUB_LIB_SPEC@'
# String to pass to linker to pick up the Itk stub library from its
# installed directory.
ITK_STUB_LIB_SPEC='@itk_STUB_LIB_SPEC@'
ITK_STUB_LIB_SPEC='@ITK_STUB_LIB_SPEC@'
# Location of the top-level source directories from which [incr Tk]
# was built. This is the directory that contains a README file as well
@@ -42,4 +44,4 @@ ITK_STUB_LIB_SPEC='@itk_STUB_LIB_SPEC@'
# compiled in a different place than the directory containing the source
# files, this points to the location of the sources, not the location
# where [incr Tk] was compiled.
ITK_SRC_DIR='@itk_SRC_DIR@'
ITK_SRC_DIR='@ITK_SRC_DIR@'
+3
View File
@@ -0,0 +1,3 @@
# Tcl package index file, version 1.0
package ifneeded Itk @ITCL_VERSION@ [list load "@ITK_PKG_FILE@" Itk]
+151
View File
@@ -0,0 +1,151 @@
/*
* tkAppInit.c --
*
* Provides a default version of the Tcl_AppInit procedure for
* use in wish and similar Tk-based applications.
*
* Copyright (c) 1993 The Regents of the University of California.
* Copyright (c) 1994 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: @(#) tkAppInit.c 1.22 96/05/29 09:47:08
*/
#include "tk.h"
#include "itk.h"
/* include tclInt.h for access to namespace API */
#include "tclInt.h"
/*
* The following variable is a special hack that is needed in order for
* Sun shared libraries to be used for Tcl.
*/
extern int matherr();
int *tclDummyMathPtr = (int *) matherr;
#ifdef TK_TEST
EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
#endif /* TK_TEST */
/*
*----------------------------------------------------------------------
*
* main --
*
* This is the main program for the application.
*
* Results:
* None: Tk_Main never returns here, so this procedure never
* returns either.
*
* Side effects:
* Whatever the application does.
*
*----------------------------------------------------------------------
*/
int
main(argc, argv)
int argc; /* Number of command-line arguments. */
char **argv; /* Values of command-line arguments. */
{
Tk_Main(argc, argv, Tcl_AppInit);
return 0; /* Needed only to prevent compiler warning. */
}
/*
*----------------------------------------------------------------------
*
* Tcl_AppInit --
*
* This procedure performs application-specific initialization.
* Most applications, especially those that incorporate additional
* packages, will have their own version of this procedure.
*
* Results:
* Returns a standard Tcl completion code, and leaves an error
* message in interp->result if an error occurs.
*
* Side effects:
* Depends on the startup script.
*
*----------------------------------------------------------------------
*/
int
Tcl_AppInit(interp)
Tcl_Interp *interp; /* Interpreter for application. */
{
if (Tcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
if (Tk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Tktest", Tktest_Init,
(Tcl_PackageInitProc *) NULL);
#endif /* TK_TEST */
/*
* Call the init procedures for included packages. Each call should
* look like this:
*
* if (Mod_Init(interp) == TCL_ERROR) {
* return TCL_ERROR;
* }
*
* where "Mod" is the name of the module.
*/
if (Itcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
if (Itk_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
Tcl_StaticPackage(interp, "Itcl", Itcl_Init, Itcl_SafeInit);
Tcl_StaticPackage(interp, "Itk", Itk_Init, (Tcl_PackageInitProc *) NULL);
/*
* This is itkwish, so import all [incr Tcl] commands by
* default into the global namespace. Fix up the autoloader
* to do the same.
*/
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
"::itk::*", /* allowOverwrite */ 1) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_Import(interp, Tcl_GetGlobalNamespace(interp),
"::itcl::*", /* allowOverwrite */ 1) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_Eval(interp, "auto_mkindex_parser::slavehook { _%@namespace import -force ::itcl::* ::itk::* }") != TCL_OK) {
return TCL_ERROR;
}
/*
* Call Tcl_CreateCommand for application-specific commands, if
* they weren't already created by the init procedures called above.
*/
/*
* Specify a user-specific startup file to invoke if the application
* is run interactively. Typically the startup file is "~/.apprc"
* where "app" is the name of the application. If this line is deleted
* then no user-specific startup file will be run under any conditions.
*/
Tcl_SetVar(interp, "tcl_rcFileName", "~/.itkwishrc", TCL_GLOBAL_ONLY);
return TCL_OK;
}
+1 -10
View File
@@ -1,4 +1,4 @@
/*
/*
* dllEntryPoint.c --
*
* This file implements the Dll entry point as needed by Windows.
@@ -7,16 +7,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if defined(_MSC_VER)
/* Only do this when MSVC++ is compiling us. */
# define DllEntryPoint DllMain
# if defined(USE_TCL_STUBS) && (!defined(_MT) || !defined(_DLL) || defined(_DEBUG))
/*
* This fixes a bug with how the Stubs library was compiled.
* The requirement for msvcrt.lib from tclstubXX.lib should
* be removed.
*/
# pragma comment(linker, "-nodefaultlib:msvcrt.lib")
# endif
#endif
/*
-1
View File
@@ -1 +0,0 @@
git-
-1
View File
@@ -1 +0,0 @@
#define ITK_VERSION_UUID \
+227
View File
@@ -0,0 +1,227 @@
# Borland C++ 4.52 makefile
#
# Copyright (c) 1993-1996 Lucent Technologies
# based on original from
# Copyright (c) 1995-1996 by Sun Microsystems, Inc.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
!include "..\..\Makefile.bc"
#
# Project directories
#
# ROOT = top of source tree
# TMPDIR = location where .obj files should be stored during build
ROOT = ..
TMPDIR = .
TARGET_LIB_ITK = $(TARGET_LIB)\Itk2.2
TARGET_DOC_ITK = $(TARGET_DOC)\Itk
# uncomment the following line to compile with symbols
#DEBUG=1
# uncomment the following two lines to compile with TCL_MEM_DEBUG
#DEBUGDEFINES =TCL_MEM_DEBUG
INCLUDES =$(BORLAND)\include;$(ROOT)\generic;$(ROOT);$(TCLDIR)\generic;$(ITCLDIR)\generic;$(TKDIR)\generic;$(TKDIR)\xlib;$(TKDIR)\bitmaps
LIBDIRS =$(BORLAND)\lib;$(ROOT)\win
!ifndef DEBUG
# these macros cause maximum optimization and no symbols
DEBUGLDFLAGS =
DEBUGCCFLAGS = -v- -vi- -O2
!else
# these macros enable debugging
DEBUGLDFLAGS = -v
DEBUGCCFLAGS = -k -Od -v
!endif
DEFINES = _RTLDLL;USE_TCLALLOC=0;STRICT;$(DEBUGDEFINES);ITCL_NAMESPACES=1
PROJECTCCFLAGS= $(DEBUGCCFLAGS) -w-par -w-stu
LNFLAGS_exe = -Tpe -aa -c $(DEBUGLDFLAGS) $(BORLAND)\lib\c0w32
LNFLAGS_dll = -Tpd -aa -c $(DEBUGLDFLAGS) $(BORLAND)\lib\c0d32
LNLIBS_exe = $(ITKLIB) $(ITCLLIBDIR)\$(ITCLLIB) $(TKLIBDIR)\$(TKLIB) $(TCLLIBDIR)\$(TCLLIB) import32 cw32i
LNLIBS_dll = $(ITCLLIBDIR)\$(ITCLLIB) $(TKLIBDIR)\$(TKLIB) $(TCLLIBDIR)\$(TCLLIB) import32 cw32i
#
# Global makefile settings
#
.AUTODEPEND
.CACHEAUTODEPEND
.suffixes: .c .dll .lib .obj .exe
.path.c=$(ROOT)\win;$(ROOT)\generic;
.path.obj=$(TMPDIR)
ITKWISHOBJS = \
$(TMPDIR)\winMain.obj
ITKOBJS = \
$(TMPDIR)\itk_archetype.obj \
$(TMPDIR)\itk_cmds.obj \
$(TMPDIR)\itk_option.obj \
$(TMPDIR)\itk_util.obj \
$(TMPDIR)\dllEntryPoint.obj
ITKWISH = itkwish.exe
#
# Targets
#
all: cfgdll $(ITKDLL) cfgexe $(ITKWISH) cfgcln
test: $(ITKWISH)
$(CP) $(TCLLIBDIR)\*.dll
$(CP) $(TKLIBDIR)\*.dll
$(CP) $(ITCLLIBDIR)\*.dll
#set ITK_
$(ITKWISH) <<|
cd ..\tests
source all
exit
|
install: all
$(MKDIR) "$(TARGET_ROOT)"
$(MKDIR) "$(TARGET_BIN)"
$(MKDIR) "$(TARGET_LIB_ROOT)"
$(MKDIR) "$(TARGET_LIB)"
$(MKDIR) "$(TARGET_LIB_ITK)"
$(MKDIR) "$(TARGET_INCLUDE_ROOT)"
$(MKDIR) "$(TARGET_INCLUDE)"
$(MKDIR) "$(TARGET_DOC)"
$(MKDIR) "$(TARGET_DOC_ITK)"
$(CP) $(TMPDIR)\$(ITKWISH) "$(TARGET_BIN)"
$(CP) $(TMPDIR)\$(ITKDLL) "$(TARGET_BIN)"
$(CP) $(ROOT)\generic\itk.h "$(TARGET_INCLUDE)"
$(CP) $(ROOT)\library\*.* "$(TARGET_LIB_ITK)"
$(CP) $(ROOT)\win\*.tcl "$(TARGET_LIB_ITK)"
$(CP) $(ROOT)\..\html\Itk\*.* "$(TARGET_DOC_ITK)"
# Implicit Targets
.c.obj:
@$(BCC32) {$< }
.dll.lib:
$(IMPLIB) -c $@ $<
.rc.res:
$(RC) -i$(ROOT)\generic;$(ITCLDIR)\generic;$(TCLDIR)\generic;$(TKDIR)\generic $<
#
# Special case object file targets
#
#
# Configuration file targets - these files are implicitly used by the compiler
#
cfgdll:
@$(CP) &&|
-n$(TMPDIR) -I$(INCLUDES) -c -WD
-D$(DEFINES) -3 -d $(PROJECTCCFLAGS)
| bcc32.cfg >NUL
cfgexe:
@$(CP) &&|
-n$(TMPDIR) -I$(INCLUDES) -c -W
-D$(DEFINES) -3 -d $(PROJECTCCFLAGS)
| bcc32.cfg >NUL
cfgtest:
@$(CP) &&|
-n$(TMPDIR) -I$(INCLUDES) -c -W
-D$(DEFINES);TCL_TEST -3 -d $(PROJECTCCFLAGS)
| bcc32.cfg >NUL
cfgcln:
@$(RM) bcc32.cfg
#
# Executable targets
#
$(ITKDLL): $(ITKOBJS) itk.def rc\itk.res
$(TLINK32) @&&|
$(LNFLAGS_dll) $(ITKOBJS)
$@
-x
$(LNLIBS_dll)
itk.def
rc\itk.res
|
$(ITKWISH): $(ITKWISHOBJS) $(ITKLIB) rc\itkwish.res
$(TLINK32) @&&|
$(LNFLAGS_exe) $(ITKWISHOBJS)
$@
-x
$(LNLIBS_exe)
|, &&|
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE MULTIPLE
|, rc\itkwish.res
#
# Other dependencies
#
# The following rule automatically generates a tk.def file containing
# an export entry for every public symbol in the $(TKDLL) library.
itk.def: $(ITKOBJS)
$(TCLLIBDIR)\dumpexts.exe -o $@ $(ITKDLL) @&&|
$(ITKOBJS)
|
# Dependencies for .rc files:
rc\itk.res: rc\*.cur rc\itk.ico
rc\itkwish.res: rc\*.cur rc\itk.ico
# debugging rules, the .dll and .exe files must be in the same
# directory as the object files for debugging purposes
$(TMPDIR)\$(ITKDLL): $(ITKDLL)
$(CP) $(ITKDLL) $(TMPDIR)
$(TMPDIR)\$(ITCLDLL): $(ITCLLIBDIR)\$(ITCLDLL)
$(CP) $(ITCLLIBDIR)\$(ITCLDLL) $(TMPDIR)
$(TMPDIR)\$(TKDLL): $(TKLIBDIR)\$(TKDLL)
$(CP) $(TKLIBDIR)\$(TKDLL) $(TMPDIR)
$(TMPDIR)\$(TCLDLL): $(TCLLIBDIR)\$(TCLDLL)
$(CP) $(TCLLIBDIR)\$(TCLDLL) $(TMPDIR)
$(TMPDIR)\$(ITKWISH): $(ITKWISH)
$(CP) $(ITKWISH) $(TMPDIR)
debug: $(TMPDIR)\$(ITKDLL) $(TMPDIR)\$(ITCLDLL) $(TMPDIR)\$(TKDLL) $(TMPDIR)\$(TCLDLL)
# remove all generated files
clean:
-@$(RM) $(ITKWISH)
-@$(RM) $(ITKLIB)
-@$(RM) $(ITKDLL)
-@$(RM) itk.def
-@$(RM) $(TMPDIR)\Rc\*.res
-@$(RM) $(TMPDIR)\*.obj
-@$(RM) *.cfg
+233 -380
View File
@@ -1,452 +1,305 @@
#------------------------------------------------------------------------------
# Visual C++ 6.0+ makefile for [Incr Tk]
# 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) 1995-1996 Sun Microsystems, Inc.
# SCCS: @(#) makefile.vc 1.8 98/07/29 13:14:52
# Does not depend on the presence of any environment variables in
# order to compile tcl; all needed information is derived from
# location of the compiler directories.
#
# Copyright (c) 1993-1998 Lucent Technologies, Inc.
#------------------------------------------------------------------------------
# To build (after setting up Visual C++ command line environment),
# nmake -f makefile.vc TCLDIR=path_to_tcl_sources TKDIR=path_to_tk_sources
# To install
# nmake -f makefile.vc TCLDIR=path_to_tcl_sources TKDIR=path_to_tk_sources INSTALLDIR=path_to_install_dir install
# 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.
!if !exist("makefile.vc")
MSG = ^
You must run this makefile only from the directory it is in.^
Please `cd` to its location first.
!error $(MSG)
!endif
!include "..\..\makefile.vc"
PROJECT = itk
PROJECT_REQUIRES_TK = 1
ITCLDIR = ..\..\itcl
!include "$(ITCLDIR)\win\rules.vc"
!if $(TCLINSTALL)
!message *** Warning: [Incr Tk] requires the source distribution of Tcl to build from,
!message *** at this time, sorry. Please set the TCLDIR and TKDIR macros to point
!message *** to the sources.
!endif
# ROOT = top of source tree
#
# TMPDIR = location where .obj files should be stored during build
!if [echo REM = This file is generated from makefile.vc > versions.vc]
!endif
!if [echo ITCL_MAJOR_VERSION = \>> versions.vc] \
&& [nmakehlp -V $(ITCLDIR)\generic\itcl.h ITCL_MAJOR_VERSION >> versions.vc]
!endif
!if [echo ITCL_MINOR_VERSION = \>> versions.vc] \
&& [nmakehlp -V $(ITCLDIR)\generic\itcl.h ITCL_MINOR_VERSION >> versions.vc]
!endif
!if [echo ITCL_PATCH_LEVEL = \>> versions.vc] \
&& [nmakehlp -V $(ITCLDIR)\generic\itcl.h ITCL_PATCH_LEVEL >> versions.vc]
!endif
!if [echo ITK_MAJOR_VERSION = \>> versions.vc] \
&& [nmakehlp -V ..\generic\itk.h ITK_MAJOR_VERSION >> versions.vc]
!endif
!if [echo ITK_MINOR_VERSION = \>> versions.vc] \
&& [nmakehlp -V ..\generic\itk.h ITK_MINOR_VERSION >> versions.vc]
!endif
!if [echo ITK_PATCH_LEVEL = \>> versions.vc] \
&& [nmakehlp -V ..\generic\itk.h ITK_PATCH_LEVEL >> versions.vc]
!endif
!include "versions.vc"
ITCL_VERSION = $(ITCL_MAJOR_VERSION)$(ITCL_MINOR_VERSION)
ITK_VERSION = $(ITK_MAJOR_VERSION)$(ITK_MINOR_VERSION)
DOTVERSION = $(ITK_PATCH_LEVEL)
ROOT = ..
ITCLDIR = ..\..\itcl
######################################################################
# Do not modify below this line
######################################################################
ITKNAMEPREFIX = itk
WISHNAMEPREFIX = itkwish
VERSION = 31
DOTVERSION = 3.1
STUBPREFIX = $(ITKNAMEPREFIX)stub
BINROOT = .
ROOT = ..
STUBPREFIX = $(PROJECT)stub
!IF "$(NODEBUG)" == "1"
TMPDIR = $(BINROOT)\Release
DBGX =
!ELSE
TMPDIR = $(BINROOT)\Debug
DBGX = d
!ENDIF
OUTDIR = $(TMPDIR)
PKGINDEX = "$(TMP_DIR)\pkgIndex.tcl"
ITKDLLNAME = $(ITKNAMEPREFIX)$(VERSION)$(DBGX).dll
ITKDLL = $(OUTDIR)\$(ITKDLLNAME)
ITKLIB = $(OUTDIR)\$(ITKNAMEPREFIX)$(VERSION)$(DBGX).lib
ITCLLIBNAME = itcl$(ITCL_VERSION)$(SUFX).$(EXT)
ITCLLIB = "$(ITCLDIR)\win\$(OUT_DIR)\$(ITCLLIBNAME)"
ITKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(ITK_VERSION)$(SUFX).lib"
ITKSTUBLIBNAME = $(STUBPREFIX)$(ITK_VERSION).lib
ITKSTUBLIB = "$(OUT_DIR)\$(ITKSTUBLIBNAME)"
ITKWISH = $(OUTDIR)\$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe
DUMPEXTS = $(TMPDIR)\dumpexts.exe
ITKLIBNAME = $(PROJECT)$(ITK_VERSION)$(SUFX).$(EXT)
ITCLIMPLIBNAME = itcl$(ITCL_VERSION)$(SUFX).$(EXT)
ITKLIB = "$(OUT_DIR)\$(ITKLIBNAME)"
ITCLIMPLIB = "$(ITCLDIR)\win\$(BUILDDIRTOP)\$(ITCLIMPLIBNAME)"
ITKSTUBLIBNAME = $(STUBPREFIX)$(VERSION)$(DBGX).lib
ITKSTUBLIB = $(OUTDIR)\$(ITKSTUBLIBNAME)
TKSTUBLIB = $(TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib
TKIMPLIB = $(TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(DBGX).lib
WISH = $(TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(DBGX).exe
TCL_LIBRARY = $(TCLDIR)\library
TK_LIBRARY = $(TKDIR)\library
ITCL_LIBRARY = $(ITCLDIR:\=/)/library
ITK_LIBRARY = $(ROOT)/library
LIB_INSTALL_DIR = $(INSTALLDIR)\lib
BIN_INSTALL_DIR = $(INSTALLDIR)\bin
SCRIPT_INSTALL_DIR = $(INSTALLDIR)\lib\itk$(DOTVERSION)
INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
ITCLSTUBLIBNAME = itclstub$(ITCL_VERSION).lib
ITCLSTUBLIB = $(ITCLDIR)\win\$(BUILDDIRTOP)\$(ITCLSTUBLIBNAME)
BIN_INSTALL_DIR = $(_INSTALLDIR)\..\bin
DOC_INSTALL_DIR = $(_INSTALLDIR)\..\doc
LIB_INSTALL_DIR = $(_INSTALLDIR)
SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION)
INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\..\include
ITKWISHOBJS = \
$(TMPDIR)\winMain.obj
ITKOBJS = \
$(TMP_DIR)\itkArchBase.obj \
$(TMP_DIR)\itkArchetype.obj \
$(TMP_DIR)\itkBase.obj \
$(TMP_DIR)\itkCmd.obj \
$(TMP_DIR)\itkHelpers.obj \
$(TMP_DIR)\itkOption.obj \
$(TMP_DIR)\itkUtil.obj \
!if !$(STATIC_BUILD)
$(TMP_DIR)\dllEntryPoint.obj \
$(TMP_DIR)\itk.res \
!endif
$(TMP_DIR)\itkStubInit.obj
$(TMPDIR)\itkStubInit.obj \
$(TMPDIR)\itk_archetype.obj \
$(TMPDIR)\itk_cmds.obj \
$(TMPDIR)\itk_option.obj \
$(TMPDIR)\itk_util.obj \
$(TMPDIR)\dllEntryPoint.obj
ITKSTUBOBJS = \
$(TMP_DIR)\itkStubLib.obj
$(TMPDIR)\itkStubLib.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
DOCDIR = $(ROOT)\doc
WINDIR = $(ROOT)\win
RCDIR = $(ROOT)\win\rc
TOOLSDIR = ..\..\tools
RCDIR = $(WINDIR)\rc
#---------------------------------------------------------------------
TCLBUILDDIR = $(TCLDIR)\win\$(OUTDIR)
TCLLIB = $(TCLBUILDDIR)\tcl81$(DBGX).lib
TCLSTUBLIB = $(TCLBUILDDIR)\tclstub81$(DBGX).lib
TCLDLL = $(TCLBUILDDIR)\tcl81$(DBGX).dll
TKBUILDDIR = $(TKDIR)\win\$(OUTDIR)
TKLIB = $(TKBUILDDIR)\tk81$(DBGX).lib
TKSTUBLIB = $(TKBUILDDIR)\tkstub81$(DBGX).lib
TKDLL = $(TKBUILDDIR)\tk81$(DBGX).dll
ITCLBUILDDIR = $(ITCLDIR)\win\$(OUTDIR)
ITCLLIB = $(ITCLBUILDDIR)\itcl$(VERSION)$(DBGX).lib
ITCLDLL = $(ITCLBUILDDIR)\itcl$(VERSION)$(DBGX).dll
ITCLSTUBLIBNAME = itclstub$(VERSION)$(DBGX).lib
ITCLSTUBLIB = $(ITCLBUILDDIR)\$(ITCLSTUBLIBNAME)
ITK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR) \
-I$(TCLDIR)\generic -I$(TKDIR)\generic \
-I$(TCLDIR)\win -I$(TKDIR)\win \
-I$(TKDIR)\xlib -I$(ITCLDIR)\generic
ITK_EXE_DEFINES = -DBUILD_itk $(DEBUGDEFINES)
ITK_EXE_CFLAGS = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
$(ITK_INCLUDES) $(ITK_EXE_DEFINES)
ITK_CFLAGS = $(ITK_EXE_CFLAGS) -DUSE_TK_STUBS -DUSE_TCL_STUBS \
-DUSE_ITCL_STUBS
######################################################################
# Link flags
#---------------------------------------------------------------------
######################################################################
!if $(DEBUG)
ldebug = -debug:full -debugtype:cv
!else
ldebug = -release -opt:ref -opt:icf,3
!endif
!IF "$(NODEBUG)" == "1"
ldebug = /RELEASE
!ELSE
ldebug = -debug:full -debugtype:cv
!ENDIF
# declarations common to all linker options
lflags = -nologo -machine:$(MACHINE) $(ldebug)
lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
!if $(PROFILE)
lflags = $(lflags) -profile
!endif
# 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
!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
# align sections for PE size savings.
lflags = $(lflags) -opt:nowin98
!else if !$(ALIGN98_HACK) && $(STATIC_BUILD)
# align sections for speed in loading by choosing the virtual page size.
lflags = $(lflags) -align:4096
!endif
conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
!if $(LOIMPACT)
lflags = $(lflags) -ws:aggressive
!endif
!IF "$(MACHINE)" == "PPC"
libc = libc.lib
libcdll = crtdll.lib
!ELSE
libc = libc.lib oldnames.lib
libcdll = msvcrt.lib oldnames.lib
!ENDIF
ITK_LFLAGS = $(lflags) -subsystem:windows -dll
ITK_LLIBS = $(TCLSTUBLIB) $(TKSTUBLIB) $(ITCLSTUBLIB)
baselibs = kernel32.lib $(optlibs) advapi32.lib
winlibs = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
guilibs = $(libc) $(winlibs)
!if exist("$(TCLDIR)\win\coffbase.txt")
ITK_DLLBASE = -base:@$(TCLDIR)\win\coffbase.txt,itk
!else
ITK_DLLBASE =
!endif
guilibsdll = $(libcdll) $(winlibs)
baselibs =
# Avoid 'unresolved external symbol __security_cookie' errors.
# c.f. http://support.microsoft.com/?id=894573
!if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
!if $(VCVERSION) > 1399 && $(VCVERSION) < 1500
baselibs = $(baselibs) bufferoverflowU.lib
!endif
!endif
#---------------------------------------------------------------------
######################################################################
# Compile flags
#---------------------------------------------------------------------
######################################################################
!if !$(DEBUG)
!if $(OPTIMIZING)
### This cranks the optimization level to maximize speed
cdebug = -O2 $(OPTIMIZATIONS)
!else
cdebug =
!endif
!if $(SYMBOLS)
cdebug = $(cdebug) -Zi
!endif
!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
cdebug = -Zi -Od $(DEBUGFLAGS)
!else
cdebug = -Zi -WX $(DEBUGFLAGS)
!endif
!IF "$(NODEBUG)" == "1"
!IF "$(MACHINE)" == "ALPHA"
# MSVC on Alpha doesn't understand -Ot
cdebug = -O2i -Gs -GD -DNDEBUG
!ELSE
cdebug = -Oti -Gs -GD -DNDEBUG
!ENDIF
!ELSE
cdebug = -Z7 -Od -WX -DDEBUG
!ENDIF
### Declarations common to all compiler options
cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
# declarations common to all compiler options
ccommon = -c -W3 -nologo -Fp$(TMPDIR)\ -YX
!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
!else
crt = -MD
!endif
!else
!if $(DEBUG) && !$(UNCHECKED)
crt = -MTd
!else
crt = -MT
!endif
!endif
!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
!if $(TCLINSTALL)
TCL_INCLUDES = -I"$(TCLDIR)\include"
TK_INCLUDES =
!else
TCL_INCLUDES = -I"$(TCLDIR)\generic" -I"$(TCLDIR)\win"
TK_INCLUDES = -I"$(TKDIR)\generic" -I"$(TKDIR)\xlib"
!endif
cvars = -DWIN32 -D_WIN32
cvarsmt = $(cvars) -D_MT
cvarsdll = $(cvarsmt) -D_DLL
ITK_INCLUDES = -I$(WINDIR) -I$(GENERICDIR)
ITCL_INCLUDES = -I"$(ITCLDIR)\generic"
ITK_DEFINES = -DBUILD_itk -DTCL_THREADS=1
ITK_EXE_CFLAGS = $(cdebug) $(cflags) $(crt) $(ITCL_INCLUDES) $(ITK_INCLUDES) \
$(TCL_INCLUDES) $(TK_INCLUDES) $(ITK_DEFINES)
!IF "$(NODEBUG)" == "1"
cvarsdll = $(cvars) -MD
!ELSE
cvarsdll = $(cvars) -MDd
!ENDIF
### By convention, static builds do not use Stubs. This is just a practice,
### not a technical limitation.
!if $(STATIC_BUILD)
ITK_CFLAGS = $(ITK_EXE_CFLAGS) -DSTATIC_BUILD $(OPTDEFINES)
!else
ITK_CFLAGS = $(ITK_EXE_CFLAGS) -DUSE_TCL_STUBS -DUSE_TK_STUBS -DUSE_ITCL_STUBS $(OPTDEFINES)
!endif
CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
#---------------------------------------------------------------------
######################################################################
# Project specific targets
#---------------------------------------------------------------------
######################################################################
all : setup $(ITKLIB) $(ITKSTUBLIB)
release : setup $(ITKLIB) $(ITKSTUBLIB)
install : install-binaries install-docs
all: setup $(ITKWISH) $(ITKDLL) $(ITKSTUBLIB)
test: setup $(ITKDLL) $(ITKSTUBLIB) $(ITKWISH)
-@copy $(TCLDLL) $(TMPDIR)
-@copy $(TKDLL) $(TMPDIR)
-@copy $(ITCLDLL) $(TMPDIR)
# $(ITKWISH)
(ROOT)\manifest.uuid:
copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid
git rev-parse HEAD >>$(ROOT)\manifest.uuid
setup:
if not exist $(TMPDIR) mkdir $(TMPDIR)
if not exist $(OUTDIR) mkdir $(OUTDIR)
$(TMP_DIR)\itkUuid.h: $(ROOT)\manifest.uuid
copy $(WIN_DIR)\itclUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\itkUuid.h
(TMP_DIR)\itkBase.obj: $(TMP_DIR)\itkUuid.h
pkgindex: $(OUT_DIR)\pkgIndex.tcl
$(OUT_DIR)\pkgIndex.tcl:
@$(COPY) << "$(OUT_DIR)\pkgIndex.tcl"
# -*- tcl -*-
# Tcl package index file, version 1.1
#
if {![package vsatisfies [package provide Tcl] 8.6-]} {return}
if {[package vsatisfies [package provide Tcl] 9.0-]} {
package ifneeded itk $(DOTVERSION) \
[list load [file join $$dir tcl9itk$(VERSION).dll] Itk]
} else {
package ifneeded itcl $(DOTVERSION) \
[list load [file join $$dir itk$(VERSION).dll] Itk]
}
package ifneeded Itk $(DOTVERSION) [list package require -exact itk $(DOTVERSION)]
$(ITKLIB) : $(ITKDLL) $(ITKSTUBLIB)
$(ITKDLL) : $(ITKOBJS) $(TMPDIR)\itk.res $(TMPDIR)\itkvc.def
set LIB=$(TOOLS32)\lib
$(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\itkvc.def \
-out:$@ $(TMPDIR)\itk.res $(TCLSTUBLIB) \
$(TKSTUBLIB) $(guilibsdll) @<<
$(ITKOBJS)
<<
!if $(STATIC_BUILD)
test :
@echo test target not supported for a static library.
!else
test : setup $(ITKLIB) $(ITKSTUBLIB)
set TCL_LIBRARY=$(TCL_LIBRARY)
set TK_LIBRARY=$(TK_LIBRARY)
set ITCL_LIBRARY=$(ITCL_LIBRARY)
set ITK_LIBRARY=$(ITK_LIBRARY)
$(TCLSH) ..\tests\all.tcl $(TESTFLAGS) -loadfile <<
load [file normalize $(ITCLLIB:\=/)] Itcl
load [file normalize $(ITKLIB:\=/)] Itk
<<
!endif
$(ITKSTUBLIB): $(ITKSTUBOBJS)
$(lib32) -nologo -out:$@ $(ITKSTUBOBJS)
setup :
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
$(ITKWISH): $(ITKWISHOBJS) $(ITKLIB) $(TMPDIR)\itkwish.res
set LIB=$(TOOLS32)\lib
$(link32) $(ldebug) $(guilflags) $(TMPDIR)\itkwish.res -out:$@ \
$(guilibsdll) $(TCLLIB) $(TKLIB) $(ITCLLIB) $(ITKLIB) \
$(ITKWISHOBJS)
$(ITKLIB): $(ITKOBJS)
!if $(STATIC_BUILD)
$(lib32) -nologo -machine:$(MACHINE) -out:$@ @<<
!else
$(link32) $(ITK_LFLAGS) $(ITK_DLLBASE) -out:$@ $(ITK_LLIBS) $(baselibs) @<<
!endif
$(TMPDIR)\itkvc.def: $(DUMPEXTS) $(ITKOBJS)
$(DUMPEXTS) -o $@ $(ITKDLLNAME) @<<
$(ITKOBJS)
<<
$(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c
$(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
set LIB=$(TOOLS32)\lib
$(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \
$(TMPDIR)\winDumpExts.obj
$(ITKSTUBLIB) : $(ITKSTUBOBJS)
$(lib32) -nologo -out:$@ $(ITKSTUBOBJS)
install-binaries:
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 $(ITKLIB) "$(SCRIPT_INSTALL_DIR)"
!if $(ITKSTUBLIB) != ""
copy $(ITKSTUBLIB) "$(LIB_INSTALL_DIR)"
!endif
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 $(ITKWISH) "$(BIN_INSTALL_DIR)"
copy $(ITKDLL) "$(BIN_INSTALL_DIR)"
copy $(ROOT)\generic\itk.h "$(INCLUDE_INSTALL_DIR)"
copy $(ROOT)\generic\itkDecls.h "$(INCLUDE_INSTALL_DIR)"
copy $(ROOT)\library\*.* "$(SCRIPT_INSTALL_DIR)"
copy $(ROOT)\win\*.tcl "$(SCRIPT_INSTALL_DIR)"
#---------------------------------------------------------------------
#
# Regenerate the stubs files.
#---------------------------------------------------------------------
!if !$(TCLINSTALL)
# Only from the sources of Tcl does genStubs.tcl exist.
#
genstubs:
$(TCLSH) $(TOOLSDIR)\genStubs.tcl $(GENERICDIR) \
$(TCLSH) $(TCLDIR)\tools\genStubs.tcl $(GENERICDIR) \
$(GENERICDIR)\itk.decls
!else
genstubs:
@echo ERROR: Can't rebuild stubs tables without the Tcl source distribution
!endif
#---------------------------------------------------------------------
#
# Special case object file targets
#---------------------------------------------------------------------
#
$(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c
$(cc32) $(ITK_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
$(TMP_DIR)\itkStubLib.obj : $(GENERICDIR)\itkStubLib.c
$(cc32) -DSTATIC_BUILD $(ITK_EXE_CFLAGS) -Zl -Fo$@ $?
$(TMPDIR)\itkStubLib.obj : $(GENERICDIR)\itkStubLib.c
$(cc32) -DSTATIC_BUILD $(ITK_CFLAGS) -Fo$@ $?
#---------------------------------------------------------------------
# Inference rules.
#---------------------------------------------------------------------
#
# Implicit rules
#
{$(WINDIR)}.c{$(TMP_DIR)}.obj ::
$(cc32) $(ITK_CFLAGS) -Fo$(TMP_DIR)\ @<<
$<
<<
{$(GENERICDIR)}.c{$(TMPDIR)}.obj:
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
{$(GENERICDIR)}.c{$(TMP_DIR)}.obj ::
$(cc32) $(ITK_CFLAGS) -Fo$(TMP_DIR)\ @<<
$<
<<
{$(WINDIR)}.c{$(TMPDIR)}.obj:
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
{$(RCDIR)}.rc{$(TMP_DIR)}.res :
$(rc32) -fo $@ -DDEBUG=$(DEBUG) $(ITK_INCLUDES) $(TCL_INCLUDES) $(ITCL_INCLUDES) $(ITK_DEFINES) $<
{$(ROOT)\unix}.c{$(TMPDIR)}.obj:
$(cc32) -DDLL_BUILD $(ITK_CFLAGS) -Fo$(TMPDIR)\ $<
#---------------------------------------------------------------------
# Generate the windows help files.
#---------------------------------------------------------------------
{$(RCDIR)}.rc{$(TMPDIR)}.res:
$(rc32) -fo $@ -r -i $(GENERICDIR) -i $(TCLDIR)\generic -i $(ITCLDIR)\generic $<
HLPBASE = $(PROJECT)$(ITK_VERSION)
HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp
HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt
DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs
HELPRTF = $(DOCTMP_DIR)\$(PROJECT).rtf
MAN2HELP = $(DOCTMP_DIR)\man2help.tcl
MAN2HELP2 = $(DOCTMP_DIR)\man2help2.tcl
INDEX = $(DOCTMP_DIR)\index.tcl
BMP = $(DOCTMP_DIR)\toaster.bmp
BMP_NOPATH = toaster.bmp
MAN2TCL = $(DOCTMP_DIR)\man2tcl.exe
winhelp: docsetup $(HELPFILE)
docsetup:
@if not exist $(DOCTMP_DIR)\nul mkdir $(DOCTMP_DIR)
$(MAN2HELP) $(MAN2HELP2) $(INDEX): $(TCLTOOLSDIR)\$$(@F)
copy $(TCLTOOLSDIR)\$(@F) $(@D)
$(BMP):
copy $(WINDIR)\$(@F) $(@D)
$(HELPFILE): $(HELPRTF) $(BMP)
cd $(DOCTMP_DIR)
start /wait hcrtf.exe -x <<$(PROJECT).hpj
[OPTIONS]
COMPRESS=12 Hall Zeck
LCID=0x409 0x0 0x0 ; English (United States)
TITLE=[Incr Tk] Reference Manual
BMROOT=.
CNT=$(@B).cnt
HLP=$(@B).hlp
[FILES]
$(PROJECT).rtf
[WINDOWS]
main="[Incr Tk] Reference Manual",,27648,(r15263976),(r65280)
[CONFIG]
BrowseButtons()
CreateButton(1, "Web", ExecFile("http://www.tcl.tk"))
CreateButton(2, "SF", ExecFile("http://sf.net/projects/incrtcl"))
CreateButton(3, "Wiki", ExecFile("http://wiki.tcl.tk"))
CreateButton(4, "FAQ", ExecFile("http://www.purl.org/NET/Tcl-FAQ/"))
<<
cd $(MAKEDIR)
copy "$(DOCTMP_DIR)\$(@B).hlp" "$(OUT_DIR)"
copy "$(DOCTMP_DIR)\$(@B).cnt" "$(OUT_DIR)"
$(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c
$(cc32) -nologo -G4 -ML -O2 -Fo$(@D)\ $(TCLTOOLSDIR)\$(@B).c $(baselibs) -link -out:$@
$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX)
$(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(ITK_VERSION) $(DOCDIR:\=/)
install-docs:
!if exist($(HELPFILE))
@xcopy /i /y "$(HELPFILE)" "$(DOC_INSTALL_DIR)\"
@xcopy /i /y "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
$(TCLSH) <<
puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..."
set f [open {$(DOC_INSTALL_DIR:\=/)/tcl$(TCL_VERSION).cnt} r]
while {![eof $$f]} {
if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} {
if {$$ver == $(ITK_VERSION)} {
puts "Already installed."
exit
} else {
# do something here logical to remove (or replace) it.
puts "$$ver != $(ITK_VERSION), unfinished code path, die, die!"
exit 1
}
}
}
close $$f
set f [open {$(DOC_INSTALL_DIR:\=/)/tcl$(TCL_VERSION).cnt} a]
puts $$f {:Include $(HLPBASE).cnt}
close $$f
<<
start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TCL_VERSION).hlp
!endif
#---------------------------------------------------------------------
# Clean up
#---------------------------------------------------------------------
tidy :
-del $(TMP_DIR)\*.pch
-del $(TMP_DIR)\*.obj
-del $(TMP_DIR)\*.res
clean : tidy
-del $(OUT_DIR)\*.exp
-del $(OUT_DIR)\*.lib
-del $(OUT_DIR)\*.dll
hose : clean
-rmdir $(OUT_DIR)
-rmdir $(TMP_DIR)
clean:
-@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)
-806
View File
@@ -1,806 +0,0 @@
/*
* ----------------------------------------------------------------------------
* nmakehlp.c --
*
* This is used to fix limitations within nmake and the environment.
*
* Copyright (c) 2002 by David Gravereaux.
* Copyright (c) 2006 by Pat Thoyts
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
* ----------------------------------------------------------------------------
*/
#define _CRT_SECURE_NO_DEPRECATE
#include <windows.h>
#ifdef _MSC_VER
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "kernel32.lib")
#endif
#include <stdio.h>
#include <math.h>
/* ISO hack for dumb VC++ */
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
/* protos */
static int CheckForCompilerFeature(const char *option);
static int CheckForLinkerFeature(char **options, int count);
static int IsIn(const char *string, const char *substring);
static int SubstituteFile(const char *substs, const char *filename);
static int QualifyPath(const char *path);
static int LocateDependency(const char *keyfile);
static const char *GetVersionFromFile(const char *filename, const char *match, int numdots);
static DWORD WINAPI ReadFromPipe(LPVOID args);
/* globals */
#define CHUNK 25
#define STATICBUFFERSIZE 1000
typedef struct {
HANDLE pipe;
char buffer[STATICBUFFERSIZE];
} pipeinfo;
pipeinfo Out = {INVALID_HANDLE_VALUE, ""};
pipeinfo Err = {INVALID_HANDLE_VALUE, ""};
/*
* exitcodes: 0 == no, 1 == yes, 2 == error
*/
int
main(
int argc,
char *argv[])
{
char msg[300];
DWORD dwWritten;
int chars;
const char *s;
/*
* Make sure children (cl.exe and link.exe) are kept quiet.
*/
SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
/*
* Make sure the compiler and linker aren't effected by the outside world.
*/
SetEnvironmentVariable("CL", "");
SetEnvironmentVariable("LINK", "");
if (argc > 1 && *argv[1] == '-') {
switch (*(argv[1]+1)) {
case 'c':
if (argc != 3) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -c <compiler option>\n"
"Tests for whether cl.exe supports an option\n"
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 2;
}
return CheckForCompilerFeature(argv[2]);
case 'l':
if (argc < 3) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -l <linker option> ?<mandatory option> ...?\n"
"Tests for whether link.exe supports an option\n"
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 2;
}
return CheckForLinkerFeature(&argv[2], argc-2);
case 'f':
if (argc == 2) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -f <string> <substring>\n"
"Find a substring within another\n"
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 2;
} else if (argc == 3) {
/*
* If the string is blank, there is no match.
*/
return 0;
} else {
return IsIn(argv[2], argv[3]);
}
case 's':
if (argc == 2) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -s <substitutions file> <file>\n"
"Perform a set of string map type substutitions on a file\n"
"exitcodes: 0\n",
argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 2;
}
return SubstituteFile(argv[2], argv[3]);
case 'V':
if (argc != 4) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -V filename matchstring\n"
"Extract a version from a file:\n"
"eg: pkgIndex.tcl \"package ifneeded http\"",
argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 0;
}
s = GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0');
if (s && *s) {
printf("%s\n", s);
return 0;
} else
return 1; /* Version not found. Return non-0 exit code */
case 'Q':
if (argc != 3) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -Q path\n"
"Emit the fully qualified path\n"
"exitcodes: 0 == no, 1 == yes, 2 == error\n", argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 2;
}
return QualifyPath(argv[2]);
case 'L':
if (argc != 3) {
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -L keypath\n"
"Emit the fully qualified path of directory containing keypath\n"
"exitcodes: 0 == success, 1 == not found, 2 == error\n", argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars,
&dwWritten, NULL);
return 2;
}
return LocateDependency(argv[2]);
}
}
chars = snprintf(msg, sizeof(msg) - 1,
"usage: %s -c|-f|-l|-Q|-s|-V ...\n"
"This is a little helper app to equalize shell differences between WinNT and\n"
"Win9x and get nmake.exe to accomplish its job.\n",
argv[0]);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, chars, &dwWritten, NULL);
return 2;
}
static int
CheckForCompilerFeature(
const char *option)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
SECURITY_ATTRIBUTES sa;
DWORD threadID;
char msg[300];
BOOL ok;
HANDLE hProcess, h, pipeThreads[2];
char cmdline[100];
hProcess = GetCurrentProcess();
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdInput = INVALID_HANDLE_VALUE;
ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = FALSE;
/*
* Create a non-inheritible pipe.
*/
CreatePipe(&Out.pipe, &h, &sa, 0);
/*
* Dupe the write side, make it inheritible, and close the original.
*/
DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE,
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
/*
* Same as above, but for the error side.
*/
CreatePipe(&Err.pipe, &h, &sa, 0);
DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE,
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
/*
* Base command line.
*/
lstrcpy(cmdline, "cl.exe -nologo -c -TC -Zs -X -Fp.\\_junk.pch ");
/*
* Append our option for testing
*/
lstrcat(cmdline, option);
/*
* Filename to compile, which exists, but is nothing and empty.
*/
lstrcat(cmdline, " .\\nul");
ok = CreateProcess(
NULL, /* Module name. */
cmdline, /* Command line. */
NULL, /* Process handle not inheritable. */
NULL, /* Thread handle not inheritable. */
TRUE, /* yes, inherit handles. */
DETACHED_PROCESS, /* No console for you. */
NULL, /* Use parent's environment block. */
NULL, /* Use parent's starting directory. */
&si, /* Pointer to STARTUPINFO structure. */
&pi); /* Pointer to PROCESS_INFORMATION structure. */
if (!ok) {
DWORD err = GetLastError();
int chars = snprintf(msg, sizeof(msg) - 1,
"Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars],
(300-chars), 0);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL);
return 2;
}
/*
* Close our references to the write handles that have now been inherited.
*/
CloseHandle(si.hStdOutput);
CloseHandle(si.hStdError);
WaitForInputIdle(pi.hProcess, 5000);
CloseHandle(pi.hThread);
/*
* Start the pipe reader threads.
*/
pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
/*
* Block waiting for the process to end.
*/
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
/*
* Wait for our pipe to get done reading, should it be a little slow.
*/
WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
CloseHandle(pipeThreads[0]);
CloseHandle(pipeThreads[1]);
/*
* Look for the commandline warning code in both streams.
* - in MSVC 6 & 7 we get D4002, in MSVC 8 we get D9002.
*/
return !(strstr(Out.buffer, "D4002") != NULL
|| strstr(Err.buffer, "D4002") != NULL
|| strstr(Out.buffer, "D9002") != NULL
|| strstr(Err.buffer, "D9002") != NULL
|| strstr(Out.buffer, "D2021") != NULL
|| strstr(Err.buffer, "D2021") != NULL);
}
static int
CheckForLinkerFeature(
char **options,
int count)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
SECURITY_ATTRIBUTES sa;
DWORD threadID;
char msg[300];
BOOL ok;
HANDLE hProcess, h, pipeThreads[2];
int i;
char cmdline[255];
hProcess = GetCurrentProcess();
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdInput = INVALID_HANDLE_VALUE;
ZeroMemory(&sa, sizeof(SECURITY_ATTRIBUTES));
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
/*
* Create a non-inheritible pipe.
*/
CreatePipe(&Out.pipe, &h, &sa, 0);
/*
* Dupe the write side, make it inheritible, and close the original.
*/
DuplicateHandle(hProcess, h, hProcess, &si.hStdOutput, 0, TRUE,
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
/*
* Same as above, but for the error side.
*/
CreatePipe(&Err.pipe, &h, &sa, 0);
DuplicateHandle(hProcess, h, hProcess, &si.hStdError, 0, TRUE,
DUPLICATE_SAME_ACCESS | DUPLICATE_CLOSE_SOURCE);
/*
* Base command line.
*/
lstrcpy(cmdline, "link.exe -nologo ");
/*
* Append our option for testing.
*/
for (i = 0; i < count; i++) {
lstrcat(cmdline, " \"");
lstrcat(cmdline, options[i]);
lstrcat(cmdline, "\"");
}
ok = CreateProcess(
NULL, /* Module name. */
cmdline, /* Command line. */
NULL, /* Process handle not inheritable. */
NULL, /* Thread handle not inheritable. */
TRUE, /* yes, inherit handles. */
DETACHED_PROCESS, /* No console for you. */
NULL, /* Use parent's environment block. */
NULL, /* Use parent's starting directory. */
&si, /* Pointer to STARTUPINFO structure. */
&pi); /* Pointer to PROCESS_INFORMATION structure. */
if (!ok) {
DWORD err = GetLastError();
int chars = snprintf(msg, sizeof(msg) - 1,
"Tried to launch: \"%s\", but got error [%u]: ", cmdline, err);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS|
FORMAT_MESSAGE_MAX_WIDTH_MASK, 0L, err, 0, (LPSTR)&msg[chars],
(300-chars), 0);
WriteFile(GetStdHandle(STD_ERROR_HANDLE), msg, lstrlen(msg), &err,NULL);
return 2;
}
/*
* Close our references to the write handles that have now been inherited.
*/
CloseHandle(si.hStdOutput);
CloseHandle(si.hStdError);
WaitForInputIdle(pi.hProcess, 5000);
CloseHandle(pi.hThread);
/*
* Start the pipe reader threads.
*/
pipeThreads[0] = CreateThread(NULL, 0, ReadFromPipe, &Out, 0, &threadID);
pipeThreads[1] = CreateThread(NULL, 0, ReadFromPipe, &Err, 0, &threadID);
/*
* Block waiting for the process to end.
*/
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hProcess);
/*
* Wait for our pipe to get done reading, should it be a little slow.
*/
WaitForMultipleObjects(2, pipeThreads, TRUE, 500);
CloseHandle(pipeThreads[0]);
CloseHandle(pipeThreads[1]);
/*
* Look for the commandline warning code in the stderr stream.
*/
return !(strstr(Out.buffer, "LNK1117") != NULL ||
strstr(Err.buffer, "LNK1117") != NULL ||
strstr(Out.buffer, "LNK4044") != NULL ||
strstr(Err.buffer, "LNK4044") != NULL ||
strstr(Out.buffer, "LNK4224") != NULL ||
strstr(Err.buffer, "LNK4224") != NULL);
}
static DWORD WINAPI
ReadFromPipe(
LPVOID args)
{
pipeinfo *pi = (pipeinfo *) args;
char *lastBuf = pi->buffer;
DWORD dwRead;
BOOL ok;
again:
if (lastBuf - pi->buffer + CHUNK > STATICBUFFERSIZE) {
CloseHandle(pi->pipe);
return (DWORD)-1;
}
ok = ReadFile(pi->pipe, lastBuf, CHUNK, &dwRead, 0L);
if (!ok || dwRead == 0) {
CloseHandle(pi->pipe);
return 0;
}
lastBuf += dwRead;
goto again;
return 0; /* makes the compiler happy */
}
static int
IsIn(
const char *string,
const char *substring)
{
return (strstr(string, substring) != NULL);
}
/*
* GetVersionFromFile --
* Looks for a match string in a file and then returns the version
* following the match where a version is anything acceptable to
* package provide or package ifneeded.
*/
static const char *
GetVersionFromFile(
const char *filename,
const char *match,
int numdots)
{
static char szBuffer[100];
char *szResult = NULL;
FILE *fp = fopen(filename, "rt");
if (fp != NULL) {
/*
* Read data until we see our match string.
*/
while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) {
LPSTR p, q;
p = strstr(szBuffer, match);
if (p != NULL) {
/*
* Skip to first digit after the match.
*/
p += strlen(match);
while (*p && !isdigit((unsigned char)*p)) {
++p;
}
/*
* Find ending whitespace.
*/
q = p;
while (*q && (strchr("0123456789.ab", *q)) && (((!strchr(".ab", *q)
&& !strchr("ab", q[-1])) || --numdots))) {
++q;
}
*q = 0;
szResult = p;
break;
}
}
fclose(fp);
}
return szResult;
}
/*
* List helpers for the SubstituteFile function
*/
typedef struct list_item_t {
struct list_item_t *nextPtr;
char * key;
char * value;
} list_item_t;
/* insert a list item into the list (list may be null) */
static list_item_t *
list_insert(list_item_t **listPtrPtr, const char *key, const char *value)
{
list_item_t *itemPtr = (list_item_t *)malloc(sizeof(list_item_t));
if (itemPtr) {
itemPtr->key = strdup(key);
itemPtr->value = strdup(value);
itemPtr->nextPtr = NULL;
while(*listPtrPtr) {
listPtrPtr = &(*listPtrPtr)->nextPtr;
}
*listPtrPtr = itemPtr;
}
return itemPtr;
}
static void
list_free(list_item_t **listPtrPtr)
{
list_item_t *tmpPtr, *listPtr = *listPtrPtr;
while (listPtr) {
tmpPtr = listPtr;
listPtr = listPtr->nextPtr;
free(tmpPtr->key);
free(tmpPtr->value);
free(tmpPtr);
}
}
/*
* SubstituteFile --
* As windows doesn't provide anything useful like sed and it's unreliable
* to use the tclsh you are building against (consider x-platform builds -
* eg compiling AMD64 target from IX86) we provide a simple substitution
* option here to handle autoconf style substitutions.
* The substitution file is whitespace and line delimited. The file should
* consist of lines matching the regular expression:
* \s*\S+\s+\S*$
*
* Usage is something like:
* nmakehlp -S << $** > $@
* @PACKAGE_NAME@ $(PACKAGE_NAME)
* @PACKAGE_VERSION@ $(PACKAGE_VERSION)
* <<
*/
static int
SubstituteFile(
const char *substitutions,
const char *filename)
{
static char szBuffer[1024], szCopy[1024];
list_item_t *substPtr = NULL;
FILE *fp, *sp;
fp = fopen(filename, "rt");
if (fp != NULL) {
/*
* Build a list of substutitions from the first filename
*/
sp = fopen(substitutions, "rt");
if (sp != NULL) {
while (fgets(szBuffer, sizeof(szBuffer), sp) != NULL) {
unsigned char *ks, *ke, *vs, *ve;
ks = (unsigned char*)szBuffer;
while (ks && *ks && isspace(*ks)) ++ks;
ke = ks;
while (ke && *ke && !isspace(*ke)) ++ke;
vs = ke;
while (vs && *vs && isspace(*vs)) ++vs;
ve = vs;
while (ve && *ve && !(*ve == '\r' || *ve == '\n')) ++ve;
*ke = 0, *ve = 0;
list_insert(&substPtr, (char*)ks, (char*)vs);
}
fclose(sp);
}
/* debug: dump the list */
#ifndef NDEBUG
{
int n = 0;
list_item_t *p = NULL;
for (p = substPtr; p != NULL; p = p->nextPtr, ++n) {
fprintf(stderr, "% 3d '%s' => '%s'\n", n, p->key, p->value);
}
}
#endif
/*
* Run the substitutions over each line of the input
*/
while (fgets(szBuffer, sizeof(szBuffer), fp) != NULL) {
list_item_t *p = NULL;
for (p = substPtr; p != NULL; p = p->nextPtr) {
char *m = strstr(szBuffer, p->key);
if (m) {
char *cp, *op, *sp;
cp = szCopy;
op = szBuffer;
while (op != m) *cp++ = *op++;
sp = p->value;
while (sp && *sp) *cp++ = *sp++;
op += strlen(p->key);
while (*op) *cp++ = *op++;
*cp = 0;
memcpy(szBuffer, szCopy, sizeof(szCopy));
}
}
printf("%s", szBuffer);
}
list_free(&substPtr);
}
fclose(fp);
return 0;
}
BOOL FileExists(LPCTSTR szPath)
{
#ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
#endif
DWORD pathAttr = GetFileAttributes(szPath);
return (pathAttr != INVALID_FILE_ATTRIBUTES &&
!(pathAttr & FILE_ATTRIBUTE_DIRECTORY));
}
/*
* QualifyPath --
*
* This composes the current working directory with a provided path
* and returns the fully qualified and normalized path.
* Mostly needed to setup paths for testing.
*/
static int
QualifyPath(
const char *szPath)
{
char szCwd[MAX_PATH + 1];
GetFullPathName(szPath, sizeof(szCwd)-1, szCwd, NULL);
printf("%s\n", szCwd);
return 0;
}
/*
* Implements LocateDependency for a single directory. See that command
* for an explanation.
* Returns 0 if found after printing the directory.
* Returns 1 if not found but no errors.
* Returns 2 on any kind of error
* Basically, these are used as exit codes for the process.
*/
static int LocateDependencyHelper(const char *dir, const char *keypath)
{
HANDLE hSearch;
char path[MAX_PATH+1];
size_t dirlen;
int keylen, ret;
WIN32_FIND_DATA finfo;
if (dir == NULL || keypath == NULL)
return 2; /* Have no real error reporting mechanism into nmake */
dirlen = strlen(dir);
if ((dirlen + 3) > sizeof(path))
return 2;
strncpy(path, dir, dirlen);
strncpy(path+dirlen, "\\*", 3); /* Including terminating \0 */
keylen = strlen(keypath);
#if 0 /* This function is not available in Visual C++ 6 */
/*
* Use numerics 0 -> FindExInfoStandard,
* 1 -> FindExSearchLimitToDirectories,
* as these are not defined in Visual C++ 6
*/
hSearch = FindFirstFileEx(path, 0, &finfo, 1, NULL, 0);
#else
hSearch = FindFirstFile(path, &finfo);
#endif
if (hSearch == INVALID_HANDLE_VALUE)
return 1; /* Not found */
/* Loop through all subdirs checking if the keypath is under there */
ret = 1; /* Assume not found */
do {
int sublen;
/*
* We need to check it is a directory despite the
* FindExSearchLimitToDirectories in the above call. See SDK docs
*/
if ((finfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
continue;
sublen = strlen(finfo.cFileName);
if ((dirlen+1+sublen+1+keylen+1) > sizeof(path))
continue; /* Path does not fit, assume not matched */
strncpy(path+dirlen+1, finfo.cFileName, sublen);
path[dirlen+1+sublen] = '\\';
strncpy(path+dirlen+1+sublen+1, keypath, keylen+1);
if (FileExists(path)) {
/* Found a match, print to stdout */
path[dirlen+1+sublen] = '\0';
QualifyPath(path);
ret = 0;
break;
}
} while (FindNextFile(hSearch, &finfo));
FindClose(hSearch);
return ret;
}
/*
* LocateDependency --
*
* Locates a dependency for a package.
* keypath - a relative path within the package directory
* that is used to confirm it is the correct directory.
* The search path for the package directory is currently only
* the parent and grandparent of the current working directory.
* If found, the command prints
* name_DIRPATH=<full path of located directory>
* and returns 0. If not found, does not print anything and returns 1.
*/
static int LocateDependency(const char *keypath)
{
size_t i;
int ret;
static const char *paths[] = {"..", "..\\..", "..\\..\\.."};
for (i = 0; i < (sizeof(paths)/sizeof(paths[0])); ++i) {
ret = LocateDependencyHelper(paths[i], keypath);
if (ret == 0)
return ret;
}
return ret;
}
/*
* Local variables:
* mode: c
* c-basic-offset: 4
* fill-column: 78
* indent-tabs-mode: t
* tab-width: 8
* End:
*/
+3
View File
@@ -0,0 +1,3 @@
# Tcl package index file, version 1.0
package ifneeded Itk 3.1 [list load [file join $dir itk31.dll] Itk]
Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Some files were not shown because too many files have changed in this diff Show More